I know, it is bad etiquette to post the same question link in other forum, but here it is my question link :
http://www.sqlservercentral.com/Forums/Topic1474579-8-1.aspx
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
Table structure and sample insert statements :
create table consumption (
code varchar(6),
prodname varchar(50),
department varchar(20),
netqty decimal(10,2),
netmrp decimal(10,2)
)
insert into consumption values ('U00180','USG JELLY IM-K','SONO',11.4,130.40)
insert into consumption values ('U00280','UNIDINE 1 LITRE SOLUTION','AKD',1.4,10.40)
insert into consumption values ('V02401','VOLINI GEL 50GM','PHYSIOTHERAPY',8,15)
insert into consumption values ('V02402','X RAY FILM DIGITAL 14"X 17"','MRI',3,26.40)
insert into consumption values ('U00380','TROPAC P DROPS ','AKD',21.46,56.78)
insert into consumption values ('U00380','TROPAC P DROPS ','AKD',10,10)
Table Data :
code prodname department netqty netmrp
U00180 USG JELLY IM-K SONO 11.40 130.40
U00280 UNIDINE 1 LITRE SOLUTION AKD 1.40 10.40
V02401 VOLINI GEL 50GM PHYSIOTHERAPY 8.00 15.00
V02402 X RAY FILM DIGITAL 14"X 17" MRI 3.00 26.40
U00380 TROPAC P DROPS AKD 21.46 56.78
U00380 TROPAC P DROPS AKD 10.00 10.00
Required Output please :
CODE PRODNAME AKD MRI PHYSIOTHERAPY SONO
NET QTY NET MRP NET QTY NET MRP NET QTY NET MRP NET QTY NET MRP
U00180 USG JELLY IM-K 11.40 130.40
U00280 UNIDINE 1 LITRE SOLUTION 1.40 10.40
U00380 TROPAC P DROPS 31.46 66.78
V02401 VOLINI GEL 50GM 8.00 15.00
V02402 X RAY FILM DIGITAL 14"X 17" 3.00 26.40
I am sorry, to post the question in such a way, but if anyone can please help me by looking the above link, I shall be thankful for your help.
Just because I think in that forum, there is less activity, so I am trying here.
Update:Question is solved and I posted the solution in the same above link. Thanks to all who participated and helped me.
See Question&Answers more detail:
os