I have to create an SQL Server 2005 query which checks for the value of one attribute in the table and based on its value, select different sets of columns. How can I do that?
for e.g.
In table 'car', if the values of 'type' attribute are 1 and 2 when type = 1, i want to execute a select 'query1' with 3 columns. when type = 2, i want to execute another select 'query2' with 4 other columns.
How do I do that? Please help.