SQL Server - IN clause with multiple fields

后端 未结 8 700
野性不改
野性不改 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条回答
  •  無奈伤痛
    2020-12-20 11:59

    I don't think that query is quite portable,it would be safer to use something like

    select * from user
    where code in ( select code from userType ) and userType in (select userType from userType)
    

提交回复
热议问题