Hi!
I have a database that contains names and surnames in it. I need to write a SELECT that would return me a count of surnames for each letter of the alphabet. In other words, i need to get something like that:
A | B | C | D | E |..
0 | 5 | 3 | 4 | 1 | ...
I can get results for each separate letter by executing, but that would mean executing ~30 selects. Is there a way to combine all these selects at once?Code:SELECT COUNT(SURNAME) as A FROM USERS WHERE SURNAME LIKE '%A'
Bookmarks