Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DISTINCT List
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
01091597
Message ID:
01091635
Views:
8
>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'
>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform