I have a query with 3 tables ('Table A', 'Table B', and 'Table C') joined and am getting to many non distinct rows.
I want to have all the fields returned where all fields in table A are distinct and 1 distinct field in Table's B and C.
For instance I want to be able to write:
select distinct(a.field1, a.field2, a.field3) B.field_x, Distinct(b.field_y) C.field_x, C.field_y (distinct C.field_z)
from tableA
inner join TableB
inner join TableC
How would I do that? I am getting way to many rows back.
I only need 5 distinct values and have 10+ fields in my select list.
Thanks in advance.
I want to have all the fields returned where all fields in table A are distinct and 1 distinct field in Table's B and C.
For instance I want to be able to write:
select distinct(a.field1, a.field2, a.field3) B.field_x, Distinct(b.field_y) C.field_x, C.field_y (distinct C.field_z)
from tableA
inner join TableB
inner join TableC
How would I do that? I am getting way to many rows back.
I only need 5 distinct values and have 10+ fields in my select list.
Thanks in advance.