nel modo che dicevo, anche in mysql funge, soltanto che è preferibile usare Select count() come dici te