desc(查询表结构)
desc dbname.tablename;
distinct
select count(distinct name)
from dbname.tablename;
查询 timestamp 格式的字段
// 传统方法效率较低
SELECT * FROM tablename createdat < '2019-01-01 00:00:00' ORDER BY ID DESC;
// 采用 UNIX_TIMESTAMP,可提高效率
SELECT * FROM tablename WHERE UNIX_TIMESTAMP(createdat) < UNIX_TIMESTAMP('2019-01-01 00:00:00') ORDER BY ID DESC;
其他常用查询参考: https://blog.csdn.net/weixin_40294332/article/details/83818501