mysql带 between and 的范围查询

来源:互联网 发布:mac地址 unix 查看 编辑:程序博客网 时间:2024/06/09 14:16

带 between and  的范围查询

1,SELECT 字段 1,字段 2,字段 3...FROM 表名 WHERE 字段 [NOT] BETWEEN 取值 1 AND 取值 2;

eg:查询年龄在21和24之间的学生信息

select * from t_student where age between 21 and 24;

eg:查询年龄不在21和24之间的学生信息

select * from t_student where age not between 21 and 24;


1 0
原创粉丝点击