Hi,
I've got two primary keys in a table:
Constraint(Quer yId, ConstraintName)
In a stored procedure I select {QueryId, ConstraintName} couples that
match some criteria, and what I want to do is specifying in my a SELECT
statement that I want all of the {QueryId, ConstraintName} that are not
in my stored procedure result. With only one field, it would be easy :
Select * from Constraint where QueryId not in (Select QueryId from
OtherTable)
My explanations are not great but I think it's enough to understand
what I want.
Select * from Constraint where QueryId and ConstraintName not in
(select QueryId ,ConstraintName from OtherTable)
--> of course not correct, but then how can I do that ?
Thx
I've got two primary keys in a table:
Constraint(Quer yId, ConstraintName)
In a stored procedure I select {QueryId, ConstraintName} couples that
match some criteria, and what I want to do is specifying in my a SELECT
statement that I want all of the {QueryId, ConstraintName} that are not
in my stored procedure result. With only one field, it would be easy :
Select * from Constraint where QueryId not in (Select QueryId from
OtherTable)
My explanations are not great but I think it's enough to understand
what I want.
Select * from Constraint where QueryId and ConstraintName not in
(select QueryId ,ConstraintName from OtherTable)
--> of course not correct, but then how can I do that ?
Thx
Comment