Does a missing tag leave a separator in a grouped label list?

group_concat joins non-NULL values using a separator. The resulting text does not retain the position of every source row.

SQLite example and interpretation

Only one of three annotations has a tag, so the joined list has a single word. Encode missing slots and specify ordering if the list must preserve positions.

WITH t(v) AS (VALUES(NULL),('rain'),(NULL)) SELECT group_concat(v,',') FROM t;

Result [["rain"]]

中文

合并标注标签时,空标签会留下分隔符吗?

group_concat 将非 NULL 值用分隔符连接。拼接结果无法表示每条原记录的位置。

SQLite 示例与适用条件

三次标注只有一个非空标签,结果只有这个词。需要保留空位或稳定顺序时应明确编码空值并指定排序。

WITH t(v) AS (VALUES(NULL),('rain'),(NULL)) SELECT group_concat(v,',') FROM t;

结果 [["rain"]]

References / 参考来源

Keep reading / 继续阅读