PIVOT TABLE
Dear All, I want to use pivot table my query below is SELECT COUNT(*) SCORE , [PLAN TYPE] FROM CORNER_EV GROUP BY [PLAN TYPE] Output:- SCORE PLAN TYPE 21 NULL 43 MEDICAID 11 NR SHORT FORM 4 PPO 130 SHORT FORM 4 SR INELIGIBLE 2 SR MEDICAID 3 SR SHORT FORM expected output in SCORE NULL MEDICAID NR SHORT FORM PLAN TYPE 21 43 11 looking to above output usiong pivot table, Please help Regards, Vipin jhaThankx & regards, Vipin jha MCP
July 20th, 2012 6:58am

Vipin, this is not pivot.Please vote as helpful or mark as answer, if it helps Cheers, Raunak | t: @raunakjhawar | My Blog
Free Windows Admin Tool Kit Click here and download it now
July 20th, 2012 7:02am

ya , I am expecting output using pivot table or any other function regards, Vipin jhaThankx & regards, Vipin jha MCP
July 20th, 2012 7:05am

in your case, the number of PLAN TYPE rows is not static which may make the PIVOT query not working. PIVOT normally works with static number of rows. other options:http://sqlserveradvisor.blogspot.se/2009/03/sql-server-convert-rows-to-columns.html regards joon
Free Windows Admin Tool Kit Click here and download it now
July 20th, 2012 7:29am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics