views:

29

answers:

2

Using mysql

I want to display two rows values in to single value

ID  Name
---------
01  Raja
02  Ravi

Expected output:

01Raja
02Ravi

How to make a query for this condition?

+3  A: 
select Concat(ID, Name)
from MyTable
RedFilter
+4  A: 

You can call CONCAT:

SELECT CONCAT(CONVERT(ID, VARCHAR(8)), Name)
FROM SomeWhere
SLaks
Small correction, Mysql (at least version 5) doesn't CONVERT to type VARCHAR(). You have to use `CONCAT(CONVERT(ID, CHAR(8)), Name)` for this to work but I think you're better using no convert at all (Red Filter suggestion)
laurent-rpnet