我在SQL Server中有一个包含这样的数据的表:
date batch name id locatio
-------------------------------------------------------------------
Jul-2010 BPRGNMCTHKDKS621010070 Kodak 42 GREATER NOIDA
Nov-2010 BPRHYMCTHHPPS607210600 HYD_HP_KV-124 HYDERABAD
Dec-2010 BPRDLMCTHHPPS613110839 Alpha 112 DELHI
Dec-2010 BPRHYMCTHHPPS607210652 HYD_HP_6J-97 HYDERABAD
Feb-2011 BPRHYMCTHHPPS607211671 HYD-HP-KV-128 HYDERABAD
Jan-2011 BTPHYMCTHHPPS607211712 HYD-HP-HPT-246 HYDERABAD
我需要类似
的输出date , batch name , id , location 1 , loct 2 , loc 3 , loc4 and so on ..
我需要基于批次名称或id进行计数。
示例输出:
date batch name id delhi hyd bang etc etc
---------------------------------------------
1 gh xyz 34 45 6