Is it possible to count the total number of rows where email = 'some.email' but only return 5 rows in one sql query?
Yes. The first can be done using COUNT(), the second using LIMIT (though your mileage may vary as database vendor).
I know how to do it in two queries: Select Count() AS mytotal FROM table WHERE email = "some.email"; Select FROM table WHERE email = "some.email" LIMIT 5;
But how should it be formatted as one SQL query if possible at all?