mysql命令行模式(5)

1
SELECT CAST('125e342.83' AS signed);

SELECT CONVERT("2017-08-29", DATE)

2
select DATEDIFF('2020-05-05','2020-02-23')

select day('2020-05-05') from t_user

select day(now()) from t_user

select month('2020-05-05') from t_user

select year('2020-05-05') from t_user

select DATE_FORMAT('2020-05-05','%Y')

3
select 列名 like '%10#%' ESCAPE '#' -- 转义字符

4
select * from t_user ORDER BY RAND() LIMIT 1 -- 任取一条数据

5(这个有问题)
select * from t_user ORDER BY  COLLATE Chinese_PRC_CS_AS_KS_WS

select * from t_user ORDER BY convert(LEFT(user_name, 1) using Chinese_PRC_Stroke_CS_AS_KS_WS) 

 

你可能感兴趣的:(mysql)