i have columns this:
userid col1 col2 col3 col4 --------------------------------------- 233432 45.2 34.2 '' 0.52
i want this:
userid colid value ------------------------- 233432 col1 45.2 233432 col2 34.2 233432 col3 '' 233432 col4 0.52
i found link below:
but doesn't answer question have.my question. using sql server 2012.
select userid,'col1',col1 'value' mytable union select userid,'col2',col2 mytable union select userid,'col3',col3 mytable union select userid,'col4',col4 mytable
Comments
Post a Comment