limit--查询结果限制返回n行
select * from table_name limit n; #n代表行数
group by--查询结果去重
select id from table_name group by id;
select name1 as name2--将查询后的列重新命名
select device_id as user_infos_example from user_profile limit 2;
order by name--查找后排序
select device_id, age from user_profile order by age;
order by name1, name2--多列排序(asc升序,desc降序)
select device_id, gpa, age from user_profile order by gpa asc, age asc;
between age1 and age2 或者 >=age1 and <= age2 或者 age in ('1', '2', '3')--查找某个年龄段的用户信息
select device_id, gender, age from user_profile where age between 20 and 23;
select device_id, gender, age from user_profile where age >= 20 and age <= 23;
不为空 age != '' 或者 age is not NULL
like-- 模糊查询
select device_id, age, university from user_profile where university like '%北京%';