1、去重: distinct
例如;需要对用户信息中的学校去重;--------SELECT DISTINCT university FROM user_profile
2、限制:limit
取用户ID的前两行数据:① SELECT device_id FROM user_profile limit 2 offset 0;-----limit X offset Y(指的是从Y+1行开始,选取X行数据)
②SELECT device_id FROM user_profile limit 2;
3、重命名:AS
重命名列名或表格名称:select device_id as 'user_infors_example' FROM user_profile LIMIT 2 OFFSET 0;
4、在什么之间:between
求值在XX与XX之间:SELECT device_id,gender,age FROM user_profile WHERE age BETWEEN 20 and 23;
5、不包含:NOT IN
展示除了XX之外的数据:SELECT device_id, gender, age, university FROM user_profile WHERE university NOT IN('复旦大学')