条件
case s.×××
when 'A'
then (case when S.×× is null then '' else '' end)
when 'B'
then( case when S.×× is null then '' else '' end)
when 'C'
then( case when S.×× is null then '' else '' end)
else s.order_class end
字符串连接以及截取某段字符串
table1.userid|| COALESCE((
SUBSTR(table1.username, position( '(' IN table1.username) ,
position(')' IN table1.username) - position( '(' IN table1.username) +1)
其中 position( '(' IN table1.username) ‘(’在字段中的位置,返回int型;
position(')' IN table1.username) - position( '(' IN table1.username) +1)获取()中的内容
substr(字符串,起始位置start,截取长度 index)