SQL Server - IN clause with multiple fields

后端 未结 8 726
野性不改
野性不改 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 12:16

    You can either use joins

    SELECT * FROM user U 
    INNER JOIN userType UT on U.code = UT.code 
    AND U.userType = UT.userType
    

提交回复
热议问题