I'm trying to do a join between tables 1 and 2 which have a 1 to many relationship.
table1 has the following fields
- createdate
- contact
- tkey (surrogate key)
table2 has the following fields
- tkey (primary key)
- status
- userfld1
- description
I want to show all items in table2 with their corresponding items in table1 grouped by table2.userfld1
select distinct t2.userfld1, t2.status, t2.description, t1.createdate, t1.contact
from table2 as t2 left join table1 as t1
on t2.tkey = t1.tkey
group by t2.userfld1
is this correct?