table有两个字段,sz和sm,当sz='1'或'2'或'3'的时候两个字段拼接,否则等于sz字段.
下面语句能实现,怎么改为一个select实现.
select concat(sz,'+',sm) as sz from table where sz in ('1','2','3')
union sz from table where sz not in ('1','2','3')
求一条判断查询语句
...全文
862打赏收藏
[求助] 判断查询怎么写?
table有两个字段,sz和sm,当sz='1'或'2'或'3'的时候两个字段拼接,否则等于sz字段. 下面语句能实现,怎么改为一个select实现. select concat(sz,'+',sm) as sz from table where sz in ('1','2','3') union sz from table where sz not in ('1','2','3') 求一条判断查询语句