SQL Server - IN clause with multiple fields

后端 未结 8 724
野性不改
野性不改 2020-12-20 11:42

Is it possible to include in a IN clause multiple fields? Something like the following:

select * from user
where code, userType in ( select code         


        
8条回答
  •  猫巷女王i
    2020-12-20 12:09

    You could use a form like this:

    select * from user u
    where exists (select 1 from userType ut
                  where u.code = ut.code
                    and u.userType = ut.userType)
    

提交回复
热议问题