Hi Team,
I want help with one select query. What I want is to skip the record if any of the value is present in another table
Table 1
id, name
1,a
2,b
3,c
4,d
Table 2
id, table1id, interests
1, 1, 11
2,1,22
3,2,28
4,3,22
5,3,28
6,4,25
The result needs to be
id, name
2,b
4,d
I am trying
select * from table1 where id in (select table1id from table 2 where interests not in (11)
Your help will be highly appriciated
Hi,
Just move “not” keyword into the first part of the query.
That should work:
SELECT *
FROM table1
WHERE id NOT IN (
SELECT table1id FROM table2 WHERE interests = 11
)
Hi
Thanks for reply.
Now error is “Subquery returns more than 1 row”
Please help
Hi megazoid,
Thanks and your solution resolved my problem.
1 Like
system
Closed
5
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.