I use following statement to select the records I want :
SELE a.po,a.item,a.qty,b.price,a.qty*b.price AS amt ;
FROM purchase a,stock b ;
WHERE a.item = b.item
However, when stock table has a item that supplied by 2 supplier, then my output will go wrong, for eg :
purchase table
po item qty
123 a 10
stock table
item supplier price
a abc 10
a bcd 9
then I get the result
123,a,10,10,100
123,a,10,9,90
How can I solve this problem by single SQL SELECT statement.
Thank In advance.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only