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

12 lines
231 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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