Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run concurring SQL query?

Tags:

sqlite

mysql

I am trying to run this sql query.

SELECT * FROM AverageFeedInfo WHERE No = (
SELECT No FROM UserResponse2 where Not Complain = '' )

When I run SELECT No FROM UserResponse2 where Not Complain = '' individually I have result 2 and 6, but if I run this

SELECT * FROM AverageFeedInfo WHERE No = (
SELECT No FROM UserResponse2 where Not Complain = '' )

I have only the result for 2 not for 6. Is it possible to get the answer for both 2 and 6. To be more clear is it possible to run the sql query like

SELECT * FROM AverageFeedInfo WHERE No = 2 or No = 6
like image 295
mr_azad Avatar asked Aug 10 '26 00:08

mr_azad


1 Answers

Generally, when checking set membership in a SQL-based context use of an IN operator is more appropriate than =.

like image 115
Uueerdo Avatar answered Aug 11 '26 19:08

Uueerdo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!