mysql - How to use WHERE inside sub SELECT? -


i trying sub-select table of users .

but error saying you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'as n1 ) limit 0, 25' @ line 7

i not understand i'm doing wrong here

select * ( select                 n1.userid,                n1.country,                n1.gender                users                 n1.country = 'us'                 , n1.gender = '1' n1 )  

i think want:

select * (select n1.userid, n1.country,  n1.gender       users n1       n1.country = 'us' , n1.gender = '1'       ) n1; 

as doesn't belong in where clause. need n1 table alias in subquery, if going use qualify column names. and, should give outer query table alias.

note: subquery not needed, guessing want actual problem.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -