Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GROUP BY clause to get comma-separated values in sqlite

My table structure is like this, using sqlite3

           CREATE TABLE enghindi (eng TEXT,hindi TEXT)

i have an table named enghindi in that there is two column named hindi, eng, i want to merge eng column's record and also combine hindi word by comma separated

look at the below table is looking like

enter image description here

i want to do look like this below

enter image description here

i want to do this with sqlite3 query

like image 986
Siddhpura Amit Avatar asked Oct 12 '13 09:10

Siddhpura Amit


1 Answers

This should work:

SELECT GROUP_CONCAT(eng), hindi FROM enghindi GROUP BY hindi;
like image 179
Sajuna Fernando Avatar answered Nov 05 '22 04:11

Sajuna Fernando