On 3 Feb 2013, at 6:40pm, "E.Pasma" <pasm...@concepts.nl> wrote:

> OK, but if one does not assume any specific (non SQL standard) features, the 
> query is something like:
> 
>       SELECT * FROM t WHERE x = (SELECT MAX (x) FROM t t2 WHERE t2.y = t.y)

Your query is not standard SQL92.  SQL92 does not allow SELECT commands as part 
of expressions.  Subqueries weren't introduced into SQL until SQL99.  Very few 
of the engines you see in popular use today implement all the features of 
SQL99, they're mostly supersets of SQL92.

> If one looks for a shortcut for this quite common query, then the equivalent 
> SQLite query is really attractive:
> 
>       SELECT * FROM t GROUP BY y HAVING MAX (x) IS NOT NULL

That is a way of including only groups where NONE of the x values in the group 
are NULL.  Is that what you want ?

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to