STR_TO_DATE(final.time, '%Y-%m-%d %H:%i:%S') AS time
select *,if(sva=1,"男","女") as ssva from taname
作为表达式的if也可以用CASE when来实现:
select CASE sva WHEN 1 THEN '男' ELSE '女' END as ssva from taname
substr(str,pos,len);//str:字符串,pos:起始位置,len:截断长度
CONCAT(str1,str2,…)
substring_index(str,delim,count) str:要处理的字符串 delim:分隔符 count:计数
group_concat([DISTINCT] 要连接的字段 [Order BY ASC/DESC 排序字段] [Separator '分隔符'])
IF(a=0, a, b) AS id
locate(subStr,string) :函数返回subStr在string中出现的位置
网友评论