EXISTS 在SQL语句中怎么用?
EXISTS
指定一个子查询,检测行的存在。
马克- to-win:马克 java社区:防盗版实名手机尾号: 73203。
SELECT DISTINCT name
FROM student
WHERE EXISTS
(SELECT *
FROM register
WHERE id = student.id);
(note that if some rows in student register.id =student.id, all those rows in student are selected out.)