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
 SQL Server Development (2000)
 How to put multiple rows into one.

Author  Topic 

BIGGY
Starting Member

17 Posts

Posted - 2006-03-14 : 17:29:41
The query:

SELECT DISTINCT
sns_shipper_serials."ShipperId", sns_shipper_serials."Shipper_invtId", sns_shipper_serials."LineNbr", sns_shipper_serials."serial", sns_shipper_serials."WhseLoc"
FROM
"SOLUSBS02APP"."dbo"."SNS_Shipper_Serials" AS sns_shipper_serials
WHERE
sns_shipper_serials."ShipperId" = 'ads0151060'
ORDER BY
sns_shipper_serials."LineNbr" ASC,
sns_shipper_serials."Shipper_invtId" ASC

Current results returned:

ShipperID LineNbr Serial
ads0151060 1 ABC
ads0151060 1 LMN
ads0151060 1 XYZ
ads0151060 2 123
ads0151060 2 (etc)
ads0151060 2
ads0151060 3(etc)

Results I'd like to see:

ShipperID LineNbr Serial1 Serial2 Serial3
ads0151060 1 ABC LMN XYZ

SamC
White Water Yakist

3467 Posts

Posted - 2006-03-14 : 17:33:33
Check the Sticky FAQ in this forum:

http://sqlteam.com/Forums/forum.asp?FORUM_ID=23
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-15 : 01:15:30
Also refer this
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx?Pending=true

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -