The DISTINCT clause applies to all columns in the list (the whole record).
>What's the syntax for multiple columns with DISTINCT?
>
>BOL only shows a single column.
>
>
>
>>Try
SELECT DISTINCT ...
>>
>>
>>>The following query works - to a point.
>>>
>>>It returns ALL the invoice records. All invoice records for a station are marked
>>>with the same invoice #, user and Done Date.
>>>
>>>I need a list that is distinct on those 3 columns, so that I only get 1 invoice record
>>>for each combination of invoice #, user and done date.
>>>
>>>Thanks
>>>
>>>
>>>select ri.id,
>>> st.station_name,
>>> ri.invoice_no,
>>> ri.user_name,
>>> ri.done_date_time
>>> from document doc
>>> join media_order mo on mo.document = doc.id
>>> join media_order_detail mod on mod.media_order = mo.id
>>> join recon_info ri on ri.mod_dtid = mod.id
>>> join station st on st.id = doc.station
>>> where st.station_name= 'KTLA'
>>>
--sb--