mysql常用函数



SELECT DATE_SUB(CURRENT_DATE, INTERVAL 3 DAY) AS three_days_ago;

SELECT DATE_ADD(current_date, INTERVAL -3 DAY) AS three_days_ago;

SELECT DATE(NOW() - INTERVAL 3 DAY) AS three_days_ago;

SELECT CURDATE() - INTERVAL 3 DAY AS three_days_ago;


 

SELECT TABLE_NAME AS '表名', AUTO_INCREMENT AS '自增键值', TABLE_ROWS AS '数据量', TRUNCATE(DATA_LENGTH/1024/1024, 2) AS '数据容量(MB)', TRUNCATE(INDEX_LENGTH/1024/1024, 2) AS '索引容量(MB)', CREATE_TIME AS '创建时间', UPDATE_TIME AS '更新时间', Table_comment AS '表注释' FROM information_schema.`TABLES` order by TABLE_ROWS desc;

 

发表评论

邮箱地址不会被公开。