mysql 特殊查询语法记录

***1、经过时间字段查询指定日期(格式为年月日)的数据***mysql

mysql 8.0以上亲测能够使用,解决了以天为单位查询数据的痛点(数据库中的时间通常都精确到时分秒)。sql

关键语法点:to_char(time,'format')数据库

SELECT * FROM "ss_attendanceworkhours" where to_char(out_time, 'yyyy-MM-dd')='2021-07-13';

 ***2、查询非空记录***ide

该语句能够检查表中指定字段是否有数据orm

select name from clase where address != null
相关文章
相关标签/搜索