I have a view which was working fine when I was joining my main table:
LEFT OUTER JOIN OFFICE ON CLIENT.CASE_OFFICE = OFFICE.TABLE_CODE.
Instead of using DISTINCT
, you could use a GROUP BY
.
MIN
/MAX
/AVG
or any other function to give you one result for fields that could return multiple values.SELECT Office.Field1, Client.Field1, MIN(Office.Field1), MIN(Client.Field2)
FROM YourQuery
GROUP BY Office.Field1, Client.Field1