GROUP BY clause to get comma-separated values in sqlite

依然范特西╮ 提交于 2019-12-22 03:44:11

问题


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

i want to do look like this below

i want to do this with sqlite3 query


回答1:


This should work:

SELECT GROUP_CONCAT(eng), hindi FROM enghindi GROUP BY hindi;


来源:https://stackoverflow.com/questions/19332722/group-by-clause-to-get-comma-separated-values-in-sqlite

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!