sql - How to Join Multiple Joins yet return Distinct Values -
I am trying to get involved in multiple tables in Table 2 of the unique ID in table 2 for many names for each ID There are 2 dates for each ID in Table 3, say 3,
When I join three tables, I get 6 rows of data for each ID. The name appears three times Frequently and every date
I have to return 3 different names to 3 rows only and 2 different dates for each ID. What is the way to do this while attending SQL?
To get a result line per line in Table 1, you can use a group function on other tables For example, if you want the last (in sequential sort order) name and date, you can select
t1.id, max (t2.name), max ( T3.datefield) Table 1 T1 to Table 2 T2 at T2. TI.ID = T. 1. In T. T. 3 T3 T.ID = T 1. T.ID on ID Group;
Comments
Post a Comment