gpt4 book ai didi

sqlite - 反规范化表并追加

转载 作者:行者123 更新时间:2023-12-03 18:47:14 25 4
gpt4 key购买 nike

如何对这张表进行非规范化


+---------+---------------------------------------------+
| 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com