select id_galery,count(id)=2 from galery_optional_inf
where id in (13)
This is legal, as it executes. Any explanation what "=2" does ?
__________________
Found a flower or bug and don't know what it is ? agrozoo.net galery
if you don't spot search button at once, there is search form: agrozoo.net galery search
Is there any practical/performance use of it ?
Besides that it works I cant see any.
__________________
Found a flower or bug and don't know what it is ? agrozoo.net galery
if you don't spot search button at once, there is search form: agrozoo.net galery search
Well, lets say you want to make a forum with a VIP club... eg, everyone over a certain number of posts. You can do COUNT(*) = 1000 or COUNT(*) > 1000, etc, and it'll show if someone is or isn't a VIP.
Good example, Keleth. It's nothing that the host language (e.g., PHP/ASP/JSP) couldn't do, of course, but sometimes it's nice to do it in the query, instead.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
__________________
Found a flower or bug and don't know what it is ? agrozoo.net galery
if you don't spot search button at once, there is search form: agrozoo.net galery search