Here is my mysql table need retrieve data
total table
MPN AML Onhand Demand
2 P 300 200
2 A 300 200
3 P 100 200
3 A 300 200
4 A 200 300
here is my output need
output
MPN AML Onhand Demand
2 P 300 200
3 A 300 200
How to retrieve data from total table that output result i need
here is my condition alway take aml type P is priority
if Ohand > demand then
show aml type P data
else
then take aml type A to compare
if aml type A Ohand >demand then
show aml type A data
else ignore it don't show aml type A and P
like output i need
i have tired before but it only appear aml type either A or P data
i am using mysql database store
how to appear aml type A and P simultaneous data that output table i show
Any 1 can show me solution with vb.net ??helpful appreciated
thx