Ikke som du har skrevet. Du kan kun returnere et enkelt felt eller type for IN
at arbejde.
Fra MSDN (IN
):
test_expression [ NOT ] IN
( subquery | expression [ ,...n ]
)
subquery - Is a subquery that has a result set of one column.
This column must have the same data type as test_expression.
expression[ ,... n ] - Is a list of expressions to test for a match.
All expressions must be of the same type as
test_expression.
I stedet for IN
, kan du bruge en JOIN
ved at bruge de to felter:
SELECT U.*
FROM user U
INNER JOIN userType UT
ON U.code = UT.code
AND U.userType = UT.userType