如何对这张表进行非规范化
+---------+---------------------------------------------+
| lemma | definition |
+---------+---------------------------------------------+
| abandon | a feeling of emotional intensity |
| abandon | forsake |
| abandon | leave behind |
| abbey | a church associated with a monastery |
| abbey | a convent ruled by an abbess |
+---------+---------------------------------------------+
如
+ --------- + --------------------------------------- ---------------------------------------- +
|引理|定义|
+ --------- + --------------------------------------- ---------------------------------------- +
|放弃情感强度的感觉抛弃
|修道院与修道院相关的教堂,修道院由女修道院统治|
+ --------- + --------------------------------------- ---------------------------------------- +
查询应该是什么?
最佳答案
SELECT lemma, GROUP_CONCAT(definition, ' ') AS definition
FROM your_table
GROUP BY lemma
GROUP_CONCAT是SQLite中可用的聚合函数之一
关于sqlite - 反规范化表并追加,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35238096/