On 13-01-2011 08:47:53 -0500, Brett Spurrier wrote:
And the following query works just fine: SELECT fid FROM signatures ti ORDER BY ti.D0 ASC LIMIT 1 OFFSET 0;
However when use this query within the WHERE clause of another query, it fails: SELECT fid, title FROM signatures WHERE fid = ( SELECT fid FROM signatures ti ORDER BY ti.D0 ASC LIMIT 1 OFFSET 0 );
With the error: "syntax error, unexpected ORDER, expecting INTERSECT or EXCEPT or UNION or ')' in: "select fid, title from signatures where fid = ( select fid from signatures ti order"
Can anyone tell why Monet can't process this, but MySQL does just fine? MS SQL works too as long as I use TOP instead of LIMIT, and keep the offset at 0 (which I would like to eventually change).
Cosmetical functions such as limit, offset and order by are considered useless by the SQL standard, and hence not supported by MonetDB. In your case it seems not necessary at all either: SELECT fid, title FROM signatures ORDER BY D0 ASC LIMIT 1 OFFSET 0;