Tuesday, 12 August 2014

Mysql get two column value in get single field

Table : user
--------------
| Id | Name  |
--------------
|  1 | Test  |
|  2 | Test1 |
|  3 | TEst2 |
|  4 | Test3 |
|  5 | Test4 |
|  6 | Test5 |
|  7 | Test6 |
--------------
Query :

selecr concat(id,":",name) as output from user

Output:
------------
| output   |
------------
|  1:Test  |
|  2:Test1 |
|  3:TEst2 |
|  4:Test3 |
|  5:Test4 |
|  6:Test5 |
|  7:Test6 |
------------

No comments:

Post a Comment