mysql - Select from select with a count -
ok believe i've done similar before, don't remember how did it.
searching around gives me similar answer's not solving issue.
ex1, query fine:
select col1, count(*) col3 db.table col2 = 0 group col1
ex2, need col3 bigger 1, tried:
select * (select col1, count(*) col3 db.table col2 = 0 group col1) col3 > 1; # not working
ex3, dont know why seems working:
select col1, count(*) col3 db.table col2 = 0 group col1 having count(*) > 1;
ok, answered own question when read error message mysql.
select * (select col1, count(*) col3 db.table col2 = 0 group col1) temp col3 > 1;
i missing alias.
Comments
Post a Comment