mysql基础查询

Mysql基础查询

1.查询部分字段

select id,name,gender from worker;

2.查询全部字段

select * from worker;

3.as设置别名查询

select workaddress as '工作地址' from worker;

4.distinct去重查询啊

select distinct workaddress as '工作地址' from worker;

5.where条件查询

select * from worker where age <=49 and worknum between 4 and 14;

6.like模糊查询

_代表一个字符,%代表任意字符

select * from worker where age <=49 and worknum between 4 and 14 and name like '张%';

7.limit分页查询

Limit 索引,查询需要显示的数量,数据索引从0开始

select * from worker limit 3,10;

posted @ 2023-07-25 11:48  常疯大虾  阅读(14)  评论(0编辑  收藏  举报