0

when i write query with empty IN clause it raised an error. e.g select city where id in()

And if i write any sub query in IN clause which return empty resultset then it wont raise error.

e.g select city where id in(select id where name='abc') where sub query return empty resultset.

Can Anybody tell me what happen behind it??

i have read this but not convincing answer. Visit Empty IN clause parameter list in MySQL

Community
  • 1
  • 1
Dhruv Kapatel
  • 873
  • 3
  • 14
  • 27

1 Answers1

1

When you write IN() you make a syntax error. When you write some sub query the syntax is correct and no error are detected. In other words the empty result set cannot be detected by the parser ans so no message.

deramko
  • 2,807
  • 1
  • 18
  • 27