记录一些sql函数-CONCAT_WS,CONCAT等

select CONCAT_WS(',',t.user_landphone,t.user_name,t.user_sex,t.user_birthday,t.province)

from lot_user t  WHERE t.user_landphone IS NOT NULL;


select CONCAT(t.user_landphone,‘,’,t.user_name,‘,’,t.user_sex,‘,’,t.user_birthday,‘,’,t.province)--concat函数,concat_ws函数用法功能一样但是写法不一样;

from lot_user t  WHERE t.user_landphone IS NOT NULL;


select t.user_landphone (length函数截取字符长度位数)

from lot_user t  WHERE t.user_landphone IS NOT NULL AND LENGTH(t.user_landphone)>10 AND t.user_landphone LIKE '1%';

你可能感兴趣的:(记录一些sql函数-CONCAT_WS,CONCAT等)