I have a table with products.
When I get information from that table, I would also like to get the ETA of that article. To do so, I am planning to get the latest purchase Order Row, that is on this article, and then get the expected delivery of this purchase.
This is three different tables and I would like it to be like another column on the query, so I can get the value from the column like I would if it was on the same table.
Is my idea possible? If there is no purchase order on this article I would like the value to be null.
Products
Int ProductId
Int Price
Sample data
ProductId Price
-----------------
1 100
2 300
PORows
Int RowId
Int ProductId
Int POId
Sample data
RowId ProductId POId
-----------------------
1 1 1
PO
Int POId
DateTime ETA
Sample data
POId ETA
-----------------------
1 2010-10-25 10:05
So the result I would want is:
ProductId Price ETA (null if no rows exist)
------------------------------------------------
1 100 2010-10-25 10:05
2 300 NULL