
October 29th, 2003, 04:49 AM
|
|
Contributing User
|
|
Join Date: Sep 2003
Location: uk
Posts: 91
Time spent in forums: < 1 sec
Reputation Power: 6
|
|
|
Help with complex query please
Hi All,
Here is my current statement:
SELECT au.AgencyID, au.UserID, au.StartDate, au.EndDate, f.IACS, f.VendorNo, f.CPH, ad.BusinessName, cn.Name
FROM dbo.Authority au INNER JOIN
dbo.User f ON au.UserID = f.ID INNER JOIN
dbo.Address ad ON f.AddrID = ad.ID INNER JOIN
dbo.ContactNames cn ON cn.AgencyID = au.AgencyID
WHERE (au.AgencyID = '201')
The above statement returns all Rows. The Authority table has Multiple records for an AgencyID/UserID combination However I want to reduce the total amount of records returned by only returning the 1st unique AgencyID/UserID combination. I'm having trouble making this complex query
Thanks
|