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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Query Help Need
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kannan_JrDBA
Starting Member

USA
4 Posts

Posted - 03/19/2013 :  21:51:37  Show Profile  Send Kannan_JrDBA a Yahoo! Message  Reply with Quote
Hi,

I need to write query to get records with below combination

PONUM LINETYPE
P-001 ITEM
P-001 SERVICE
P-002 SERVICE
P-002 MATERIAL
P-002 ITEM
P-003 ITEM
p-003 MATERIAL
p-004 ITEM
p-005 MATERIAL
p-006 SERVICE
.
.
.
.

I have to get the PONUM for combination of (SERVICE, ITEM, MATERIEL) or (SERVICE and ITEM) or (SERVICE and MATERIAL).

Expected output:
P-001 ITEM
P-001 SERVICE

P-002 SERVICE
P-002 MATERIAL
P-002 ITEM

Could some one please help me to write the SQL.

Thanks
Kannan.

Thank you

Kannan

russell
Pyro-ma-ni-yak

USA
5071 Posts

Posted - 03/19/2013 :  22:56:50  Show Profile  Visit russell's Homepage  Reply with Quote
Please show us the table definitions.
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.08 seconds. Powered By: Snitz Forums 2000