Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Product_Id Description
- BX01 Desc 1
- BxX1 Desc 2
- Dss3 Desc 3
- HHXY Desc 4
- DECLARE @ProID VARCHAR(8000)
- SELECT @ProID = COALESCE(@ProID + ' - ', '') + Product_Id FROM TABLE
- SELECT @ProID
- SELECT GROUP_CONCAT(
- CONCAT( @rownum := @rownum + 1, '-', Product_Id )
- SEPARATOR ','
- ) AS data
- FROM table, ( select @rownum := 0 ) r
- SET @a:=0;
- SELECT CONCAT( @a:=@a+1,'-',Product_Id) FROM TABLE ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement