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.
这是我要过滤的表结构的图片。要知道表中是否存在全等数据,我尝试获取具有完全相同 joblat 和 joblng 值的所有行。
请有人给我一个提示或答案如何做到这一点?
谢谢
您可以使用运算符找到这样的行EXISTS:
EXISTS
SELECT * FROM t WHERE EXISTS ( SELECT 1 FROM t AS x WHERE x.pk <> t.pk -- replace this actual primary key column AND x.joblat = t.joblat AND x.joblng = t.joblng )