there is a table having two columns no and name
and the data is
1 A
2 B
3 C

write a query that will result a horizontal output
A,B,C

Answer Posted / b

Select case when 1 then 'A'
when 2 then 'B'
when 3 then 'C' end as Name from tablename

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sql server free?

670


What do you mean by acid?

758


How would you go about developing a ssrs report?

135


How to create a stored procedure with a statement block in ms sql server?

747


What are binary string data types in ms sql server?

817






How to convert character strings into numeric values?

773


Explain the commands in sql server?

730


How many categories of data types used by sql server?

763


Can sql servers linked to other servers like oracle?

694


In which sql server version report builder introduced?

125


What are various ways to enhance the ssrs report?

719


You want to check the syntax of a complicated update sql statement without executing it. What command should you use?

677


What will be the maximum number of indexes per table?

708


How except clause is differs from not in clause?

702


What is the difference between getdate and sysdatetime?

718