Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两张桌子:
表格1
ID ServiceID 01 21 02 22 03 23
表2
ID Value 01 NULL 02 value2 03 NULL
我想ServiceIDs从其中没有值Table1的 ID 中选择那些。输出将是:Table2NULL
ServiceIDs
Table1
Table2
NULL
ServiceID 22
我可以用 C# 编写代码,但对 SQL 一点也不好。请帮忙。
SELECT t1.ServiceID FROM Table1 t1 INNER JOIN Table2 t2 ON t1.ID = t2.ID WHERE t2.Value IS NOT NULL