Let's say I have a MySQL query, for example:
SELECT id, name, surname FROM employees ORDER BY id
The result is:
id name surname
1 Peter Smith
2 John Banjo
...
1384 Will Levenstein
While this is an ordered query, I can always assume (until I change the table) that it John Banjowill come out second.
Now, if my request was
SELECT id, name, surname FROM employees WHERE name = 'John' AND surname = 'Banjo'
Can I somehow get the number of rows in the first query? I am trying to do this in a much more complex, but always ordered request, is there any way to archive this?
source
share