Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct problem

Status
Not open for further replies.

ckevin

MIS
Jul 22, 2003
8
US
Hi everybody,

I have a table PO, has the field PO_number, PO_customer and PO_itemnumber

What I want to do is to list out all the 3 columns of information, by using distinct on PO_number and PO_customer

I find I can show out PO_number and PO_customer information by using this query:

select distinct PO_number, PO_customer
from PO
order by PO_number

By how can I get the PO_itemnumber?

Thank you very much
 
For each combination of PO_number and PO_customer, which of the possible PO_itemnumber values should be chosen?
 
All PO_itemnumber should be shown for each combination of PO_number and PO_customer

Thank you again
 
Can you provide sample data and from that data what result you want to see?

-SQLBill
 
Doesn't seem like there would be anything distinct about it then...
 
What is wrong with the data returned by this:

select distinct PO_number, PO_customer, PO_itemnumber
from PO
order by PO_number


-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top