22,210
社区成员
发帖
与我相关
我的任务
分享
select * from 表 where 'KKnd123' in (A1,B1,A2,B2,A3,B3,A4,B4,A5,B5)
参数时把值替换成参数select ‘a1’ from table where a1 = ‘KKnd123’
union all
select ‘a2’ from table where a2 = ‘KKnd123’
union all
select ‘a3’ from table where a3 = ‘KKnd123’
union all
select ‘a4’ from table where a4 = ‘KKnd123’
union all
select ‘a5’ from table where a5 = ‘KKnd123’
设计数据库时要用心,这种结构设计出来自己给自己找麻烦