22,207
社区成员
发帖
与我相关
我的任务
分享
SELECT UserCode FROM Users where UserCode in ('000515','009802','004498','008096','008147') and CanLogin='1'
--防止UserCode是数值型 转换下
where
charindex(','+ltrim(UserCode)+',',','+'000515,009802,004498,008096,008147'+',')>0
where
charindex(','+UserCode+',',','+'000515,009802,004498,008096,008147'+',')>0
SELECT *
FROM [Users]
where CanLogin='1'
and
UserCode in('000515','009802','004498','008096','008147')
SELECT UserCode FROM Users where UserCode in ('000515','009802','004498','008096','008147' and CanLogin='1' )