[email protected] writes:
Now I put that SQL into a function. And when the function is called, it instead gave out "C", which also fulfilled the date and product_id requirement.
Is there a way I could get "A" no matter what? Hopefully without adding
extra WHERE clauses
The only way to know in which order you get the rows in SQL is to use
the ORDER BY clause. I don't think it makes any sense to use the LIMIT
clause without an ORDER BY clause, apart from interactive data discovery
at the prompt.
--
Dimitri Fontaine
PostgreSQL DBA, Architecte
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)