I have to generate dynamic columns for a temp table.
I have a temp table with column a, the column b should be generated based on a condition.
B conditions are if value> 10 i have to genrate the column as 10 and if the value >20 the
column name should be 20 etc....n values....
If i select the table with the condition 20, my output should be
If i select the table with the condition 100, my output should be
Can any one help me how to generate this based on T-sql
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!