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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show only once

Status
Not open for further replies.

mypeljo

Technical User
Apr 16, 2010
12
BG
I have a query consisting of the fields productid and customerid.It shows the products bought by the customers.These products are bought with different orders.Therefore they are repeated many times for one and the same customerid. I want to show however only the clients that have bought this product.Therefore is it possible to restrict the query and show the customerid for a given productid only once.
For example

Productid customerid

1409 3000
1409 3000
1409 3000
1409 3000

Is it possible for the query to show only:
1409 3000
 
Try
Code:
Select DISTINCT productid, customerid
From ...
[blue]...etc. ...[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top