Re: need help
От | Carlos Chapi |
---|---|
Тема | Re: need help |
Дата | |
Msg-id | CAAk_w-qkwCtrKP5FH4Xro0=xdKj=LAnBdG4ZaV1s7fd5_eRSRw@mail.gmail.com обсуждение исходный текст |
Ответ на | need help (denero team <deneroteam@gmail.com>) |
Ответы |
Re: need help
|
Список | pgsql-sql |
Hello,
Maybe this query can help you
FROM location l
INNER JOIN product_move m ON m.source_location = location.id
INNER JOIN product p ON m.product_id = p.id
WHERE p.id = $product_id
AND m.datetime < $given_date
ORDER BY datetime DESC LIMIT 1
It will return the name of the product and the location for a given id and date.
2013/2/21 denero team <deneroteam@gmail.com>
Hi All,
I need some help for my problem.
Problem :
I have following tables
1. Location :
id, name, code
2. Product
id, name, code, location ( ref to location table)
2. Product_Move
id, product_id ( ref to product table), source_location (ref to
location table) , destination_location ( ref to location table) ,
datetime ( date when move is created)
now i want to know for given period of dates, where is the product actually.
can anyone help me ??
Thanks,
Dhaval
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
В списке pgsql-sql по дате отправления: