开发者

i want Oracle Query for Formatted Output

开发者 https://www.devze.com 2022-12-30 21:48 出处:网络
Following is my table deign EcodeDegreeYOQ 7654321SSC2000 7654321HSC开发者_开发问答2002 7654321Bcom2006

Following is my table deign

Ecode           Degree              YOQ
7654321         SSC                 2000
7654321         HSC          开发者_开发问答       2002
7654321         Bcom                2006
7654321         MCA                 2010
7654322         SSC                 2002
7654322         HSC                 2004
7654322         Bcom                2007
7654323         SSC                 2002
7654323         HSC                 2004
7654323         BE                  2008

i want following formatted output using oracle query

Ecode        Degree                           year
7654321      SSC,HSC,Bcom,MCA                 2000,2002,2006,2010          
7654322      SSC,HSC,Bcom                     2002,2004,2007
7654323      SSC,HSC,BE                       2002,2004,2008

Thanks in Advance

Vivek shah


SELECT ecode,wm_concat(DEGREE),wm_concat(yoQ) FROM TABLE_NAME GROUP BY ecode

0

精彩评论

暂无评论...
验证码 换一张
取 消