1
我有以下表選擇UNION ALL光標
tab_1:
(rs)
rs1
rs2
rs3
tab_2:
(rs) (cell) (tf)
rs1 A549 tf1
rs1 C555 tf2
rs3 B333 tf1
我需要循環的tab_1中僅列,並檢查:
SELECT count(distinct cell) from tab_2 where rs = 'rs1'
union all
SELECT count(distinct cell) from tab_2 where rs = 'rs2'
union all
SELECT count(distinct cell) from tab_2 where rs = 'rs3';
並得到結果
2
0
1
燦不明白光標應該如何工作或只是一個簡單的循環(
非常感謝!完美的作品。 –