FunSQL.jl icon indicating copy to clipboard operation
FunSQL.jl copied to clipboard

Prototype ADQL support

Open xitology opened this issue 1 year ago • 3 comments

xitology avatar Aug 31 '24 16:08 xitology

This limit style does SELECT TOP n rendering, right? I think it was introduced and popularized by Microsoft as part of their T-SQL dialect. Would probably be more understandable to call it :TSQL, it's definitely way more popular than ADQL :)

aplavin avatar Sep 20 '24 15:09 aplavin

This limit style does SELECT TOP n rendering, right? I think it was introduced and popularized by Microsoft as part of their T-SQL dialect. Would probably be more understandable to call it :TSQL, it's definitely way more popular than ADQL :)

Unfortunately, T-SQL syntax is not quite the same as ADQL's. This is because they handle OFFSET clause differently.

In ADQL (judging by the reference), OFFSET m is an independent clause that can be used alone or in combination with SELECT TOP n.

By contrast, older versions of T-SQL supported SELECT TOP n syntax, but had no way to skip initial rows, while newer versions support ANSI SQL compatible syntax ORDER BY ... OFFSET m ROWS. However T-SQL prohibits using both SELECT TOP n and OFFSET m ROWS in the same query and instead requires ANSI SQL syntax ORDER BY ... OFFSET m ROWS FETCH NEXT n ROWS.

xitology avatar Sep 23 '24 00:09 xitology

Oh, didn't know those differences! I think I only used TOP selection without any offsets, just to get a few rows and see if they look reasonable – before loading the full dataset.

aplavin avatar Sep 23 '24 13:09 aplavin