Re: simple (?) join
| От | justin |
|---|---|
| Тема | Re: simple (?) join |
| Дата | |
| Msg-id | 4ABE6324.3060601@emproshunts.com обсуждение исходный текст |
| Ответ на | Re: simple (?) join ("Oliveiros C," <oliveiros.cristina@marktest.pt>) |
| Список | pgsql-sql |
Oliveiros C, wrote:
No its not, Hello, Justin, Gary.Justin, your (the second one) query is not much different from mine.
Yes gary please do if these do not answer your questions???You previewed the possibility of having orders without any matching entry on orders_log with your left join, something that I haven't. Gary, will you haverecords on your orders table that don't reference any record on your orders_log table? If so, Justin's query is the right one you should use.You return the full record from orders and an additional column from orders_log, the ol_timestamp column. I understood that Gary wanted the full record from orders_log, notjust the timestamp column. That part is done by my subquery .I think Gary could clarify what he wants exactly. Gary? :)
Also, Justin, your query design seems right to me, but maybe you should add this (the part in comment) to your subquerySELECT MAX(ol_timestamp) /* as ol_timestamp */ , o_id FROM orders_log group by o_idbecause the MAX(ol_timestamp) will receive the name max, not ol_timestamp, and probablythe parser will complain that column ol_timestamp does not exist.Ain't I right?
Yes you are correct i forgot to add the AS
В списке pgsql-sql по дате отправления: