Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Can anyone help regarding this SQL query:
Given table:

EmpID -- EmpName
1 -- LG
2 -- NOKIA
3 -- Samsung
4 -- TATA

Our output should be:
LG, NOKIA, Samsung, TATA

Also can you provide some useful resource for SQL Interview Queries.

Thanks in advance :)
Posted
Updated 15-Oct-10 8:31am
v2
Comments
HimanshuJoshi 15-Oct-10 14:57pm    
Get a book on SQL query and study it completely.

wait...what? you just want
SQL
SELECT EmpName FROM TableName ORDER BY EmpName ASC

or
SQL
SELECT EmpName FROM TableName ORDER BY EmpID ASC


If that's the case, then here's the only answer you need for an interview over SQL:

I don't know anything about SQL
 
Share this answer
 
Comments
HimanshuJoshi 15-Oct-10 14:55pm    
I upvoted you to counter vote the stupidity.
this link will be useful to mastering sql
 
Share this answer
 
Use a cursor and string concatenation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900