查询单条语句
单循指定字段
查询日期限制
查询逻辑 where type = ‘T’
and or in
查询非空,is null ,is not null
查询非空要加上is
利用变量查询
后边要加上where id = '$_POST[text]'
查询后几条数据,后边要加上limit $n
查询前几条数据,要用limit 0,$n
注意:前几条数据,是从0开始的。
查询从指定位置开始的数据:limit $_post[begin],$n
添加别名用as
查询介于中间的数据用:
between and
in ( )
> and <
查询指定年龄:where age = '$_post[age]'
查询制定年龄:where date = '$_POST[date]'
not 和null 不一样,not是指不在什么里边,不需要加上is ,而 null 需要加上 is限制修饰。
not in
is not null
not between and
统计结果:count ,max ,min,avg,sum
group by和order by的使用:
通常情况下,是将group by放在前,将order by放在后,
并且order by还可以加上排序顺序:升序还是降序,默认情况下是升序排序的。
模糊查询:like,%里边还可以加上‘_’来占位,指定第几个位置。
在添加数据的时候有全字段添加和非全字段的添加。