ADQL and SQL

From: Alberto Micol <Alberto.Micol-at-eso.org>
Date: Tue, 10 Feb 2004 02:42:31 +0100

3 small points:

  1. Quoting Tony Linde <ael-at-star.le.ac.uk>:

> Yep - just tried it! With:
>
> Select t.a, g.d from Tab a, Tab d where a.d < d.e and (a.f < d.f or a.f=1.7)
> order by t.f, g.b
>
> into http://skyservice.pha.jhu.edu/devel/AdqlTranslator/Convertor.aspx
>
> T.

I just tried, and got back a nice, but wrong, ADQL in the sense that the original SQL is wrong (the 't' and 'g' table aliases are not defined). I wonder whether ADQL should or could take care of stopping wrong queries from being executed ... I guess not ... in the reported example it is not too bad, since the SQL parser will return a syntax error anyway; but there other cases where the query is syntactically correct but would provide meaningless results (eg, select a, count(*) from b group by d ) Dreaming?

2) BTW, in SQL-92 first the parenthesis are evaluated, then the precedence is: IS, NOT, AND, OR and left to right for operators at the same level.

3) Why are the table aliases required ? That's not standard SQL... I presume that's just the way the Convertor.aspx was built. I mean, while in ADQL we might want to have the aliases always defined the convertor should be able to accept any standard SQL statement, for example one which has no table aliases.

Alberto Received on 2004-02-10Z02:43:27