Subject | Re: [firebird-support] Calling a SP without modify the 'from ***' statement |
---|---|
Author | PenWin |
Post date | 2010-01-27T09:47:59Z |
> hi all, i have this 2 table (there i simplify them)SELECT u.ID, (SELECT FIRST 1 d.ID FROM Documents d WHERE d.USER_ID=u.ID
>
> Users
> {
> integer ID
> }
>
> Documents
> {
> integer ID,
> integer USER_ID //it's a FK
> timestamp CREATION_TIME
> }
>
> now i have this query
>
> select u.ID from Users u
>
> i need to modify that to have also the last document but i can change only the select statement, not the from ***,
>
ORDER BY d.CREATION_TIME DESC) LAST_DOCUMENT_ID FROM Users u