|
ktkn
Starting Member
13 Posts |
Posted - 12/04/2012 : 15:47:07
|
I have tbl_sale table below with two columns
orderNo purchaseNo 123 50 123 10 456 20 789 40
There are many purchaseNo within the table and don't know what is the min value is. I have the query below to get the min number for particular orderNo but not sure if mine sysntax is correctted? The result i want is orderNo purchaseNo 123 10
Thanks
SELECT orderNo, purchaseNo FROM tbl_sale where purchaseNo = (SELECT MIN(purchaseNo) FROM tbl_sale where orderNo = 123) and orderNo = 123 |
|