August 14, 2013 at 3:31 pm
my table select name,value from xxtable gives the result
nodename value
DTP02_DateTimePeriodFormatQualifier D8
DTP03_AdjudicationorPaymentDate 20130408
SVD_LineAdjudicationInformation NULL
C003_CompositeMedicalProcedureIdentifier_3 NULL
C00301_ProductorServiceIDQualifier HC
how do i transform the result set or table columns eg. using tsql
DTP02_DateTimePeriodFormatQualifier | DTP03_AdjudicationorPaymentDate ....... etc...
-----------------------------------------------------------------------
D8 20130408
August 14, 2013 at 3:53 pm
Look up the syntax for PIVOT BY. But if those are your only two columns, it might not work directly- you may have to add a constant-valued column.
August 14, 2013 at 6:35 pm
ron morgan (8/14/2013)
how do i transform the result set or table columns eg. using tsql
See the following article for two different methods. Instead of using SUM(), use MAX().
http://www.sqlservercentral.com/articles/T-SQL/63681/
After that and if you want to do it dynamically, see the following article...
http://www.sqlservercentral.com/articles/Crosstab/65048/
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply