MySQL subquery unwanted result -
so have come subquery
select movies.movieid, movies.user movies movies.user in(select movies.user movies movies.movieid = '19') , movies.movieid <> (select movies.movieid movies movies.user='5' , movies.movieid = '19') , movies.movieid <> '19'
and gives me result
-------------------------- | movieid | user | -------------------------- | 20 | 4 | -------------------------- | 21 | 4 | -------------------------- | 22 | 5 | -------------------------- | 23 | 4 | --------------------------
how can rid of result user 5?
i think problem @
and movies.movieid <> (select movies.movieid movies movies.user='5' , movies.movieid = '19')
but when try run query alone
select movies.movieid movies movies.user='5' , movies.movieid = '19'
it gives me 1 result out of 2, 19, movieid 22 not returned. result of query correct. why 22 returned when run in subquery?
can me please? thanks
if don't want records user = 5 add
and movies.user <> '5'
your subquery
select movies.movieid movies movies.user='5' , movies.movieid = '19'
says, select movieid movieid 19 , user 5. query return 19.
so this
and movies.movieid <> (select movies.movieid movies movies.user='5' , movies.movieid = '19')
says don't want movieid = 19, why in final query still record movieid = 5.