sql语句

来源:互联网 发布:阿里云cdn防盗链 编辑:程序博客网 时间:2024/06/06 17:26

1 根据值长度排序

SELECT * FROM user ORDER BY LENGTH(relBigPic) desc



2 mysql Host 'XXX' is not allowed to connect to this MySQL serve

grant all privileges on *.* to '用户名'@'%' identified by '密码' with grant option;

flush   privileges;


3 根据日期排序

select DATE_FORMAT(time,'%Y%m%d') days,count(1) count from article group by days order by days desc;

0 0