How do you prefer a human label over a fallback model label?
coalesce returns the first non-NULL candidate in argument order and yields NULL if all candidates are missing.
SQLite example and interpretation
An empty human string still wins over a model label. Normalize it with NULLIF first when the intake convention treats blanks as missing.
SELECT coalesce('', 'dog'),coalesce(nullif('',''),'dog');Result [["", "dog"]]
中文
如何按人工标签、模型标签的优先级选值?
coalesce 从左到右选取第一个非 NULL 的值,所有候选都为空时结果也是 NULL。
SQLite 示例与适用条件
人工值为空字符串时会覆盖模型结果。若录入规范把空串视为未填,先用 NULLIF 转换。
SELECT coalesce('', 'dog'),coalesce(nullif('',''),'dog');结果 [["", "dog"]]