02MYSQL查询语句

查询语句是用于将表里的数据查询出来==查询可以返回一个结果集(表)

     | 或者的意思   * 代表当前表的所有字段

**查询语句的语法:select *| 字段名列表 from 表名 [where 条件]

     创建多条件查询: not>!    and>&&   or>||

eg:

1、查询表所有的字段   select*from 表名;

2、查询表的名字,年龄,性别

select stu_name,age,sex from my_stu;

3、查询表的名字,年龄,性别  并满足年龄大于等于34

select stu_name,age,sex from my_stu where age>=34;

4、查询表的名字,年龄,性别  并满足年龄大于等于34 并且性别为女

select stu_name,age,sex from my_stu where age>=34 and sex='male';

猜你喜欢

转载自www.cnblogs.com/zicohaha/p/10585559.html