qfedu-linux-advanced-level/day9/DQL/search7_2.sql

12 lines
231 B
MySQL
Raw Normal View History

use studb;
-- 从多个表中查询数据时,如果存在相同的字段时,字段名前必须加表名
select distinct t1.sid
from t_stu t1, t_stu t2;
where t1.sid > 2 and t2.sid > 3;
/*
7
*/