DISTINCT and INNER JOIN

LeonR

Well-known member
Joined
Nov 2, 2006
Messages
139
Location
UK
Programming Experience
10+
I have a SQL problem that has been bugging me, it should be simple but I can't 'quite' get the results im after.

I have 2 tables, Table 1 and Table 2.

Table 1 contains lots of orders, each line is an order (order number, customer number etc) , using DISTINCT, I can return just 1 of each order number, so thats fine.

However, Table 2 contains the customer number AND the customer name etc , so how do I go about returning a customer name (table 2) aswell as the distinct order ID (table 1) (customer number is present in both tables)


I'm very close but I cannot quite get there.

Thanks!
 
Ok I've done it now, infact I had done it ok originally, my test data was not correct causing invalide data to be returned!!!
 
Back
Top