SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to display all columns of distinct rows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

madhan
Starting Member

35 Posts

Posted - 04/17/2014 :  21:54:16  Show Profile  Reply with Quote
I have the below working query


select distinct OrderNum from invoiceHistory where orderNum in (56387,57930,57933,57935)


I need to get all columns of the distinct ordernum as resultset. I am working to get the resultset of below.


select invoiceID,distinct orderNum,invoiceDate from invoiceHistory where orderNum in (56387,57930,57933,57935)


Please help on this query.

Edited by - madhan on 04/17/2014 22:28:56

waterduck
Aged Yak Warrior

Malaysia
965 Posts

Posted - 04/18/2014 :  05:12:08  Show Profile  Reply with Quote
select distinct OrderNum,invoiceID,invoiceDate from invoiceHistory where orderNum in (56387,57930,57933,57935)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000