selecting the first row from the second table in a join

micki_free

New member
Local time
Today, 00:11
Joined
May 1, 2008
Messages
8
Hi all

I have created an outer left join between tables. However the data is a bit messed up and the second table has multiple tuples that tally up with the tuples in the first table

is it possible to only display the first set of values from the second table, ensuring that each tuple in table one is only displayed once?
 
Code:
SELECT sites_users_and_role.PUID, sites_users_and_role.PUID_Name, sites_users_and_role.Create_Date, PUID_and_UINs.UINs, [B]Authorised_Demanders.Authorised_Demander[/B], UIN_TLB_MG.[TLB Code], TLBNames.[TLB Name]
FROM ((sites_users_and_role LEFT JOIN (PUID_and_UINs [B]LEFT JOIN Authorised_Demanders ON PUID_and_UINs.UINs = Authorised_Demanders.UINs[/B]) ON sites_users_and_role.PUID_Name = PUID_and_UINs.PUID_Name) LEFT JOIN UIN_TLB_MG ON PUID_and_UINs.UINs = UIN_TLB_MG.UINs) LEFT JOIN TLBNames ON PUID_and_UINs.UINs = TLBNames.UINs
ORDER BY sites_users_and_role.Service_TYPE;

basically i am concerned with this part of the join.

there are multiple Authorised_Demanders records for each PUID_and_UINs record. so instead of a single line being displayed per sites_users_and_role record i get multiple lines

i just want to display the first tuple and i want to do it in a query if possible. any ideas?
 

Users who are viewing this thread

Back
Top Bottom