Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Query Help Need

Author  Topic 

Kannan_JrDBA
Starting Member

4 Posts

Posted - 2013-03-19 : 21:51:37
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

5072 Posts

Posted - 2013-03-19 : 22:56:50
Please show us the table definitions.
Go to Top of Page
   

- Advertisement -