Which planned test IDs still lack an execution?

EXCEPT returns distinct rows present on the left and absent on the right. Projection defines what counts as a match.

SQLite example and interpretation

A plan lists a,b,c and only b ran. Project the case ID before comparing so run timestamps cannot change the matching unit.

WITH plan(id) AS (VALUES('a'),('b'),('c')), ran(id) AS (VALUES('b')) SELECT id FROM plan EXCEPT SELECT id FROM ran ORDER BY id;

Result [["a"], ["c"]]

中文

怎样列出测试计划中尚未执行的用例?

EXCEPT 取左查询有、右查询无的不同结果行,投影字段决定差集比较单位。

SQLite 示例与适用条件

计划 a、b、c,运行记录只有 b。若右表还带运行时间,应先投影用例编号,否则两侧比较的不是同一单位。

WITH plan(id) AS (VALUES('a'),('b'),('c')), ran(id) AS (VALUES('b')) SELECT id FROM plan EXCEPT SELECT id FROM ran ORDER BY id;

结果 [["a"], ["c"]]

References / 参考来源

Keep reading / 继续阅读