A question about MySQL asks for the output to come out in that response format.
When I finish my solution through a query in MySQL , I encounter the following problem.
Below is a first example solution of my query that Works
SELECT CONCAT('There are a total of ' , COUNT(name),' ', occupation ) FROM OCCUPATIONS GROUP BY occupation ORDER BY COUNT(name) ASC ;
Below is a second example of my query that does not work
SELECT CONCAT ('There are a total of', COUNT (name) AS numb , '', occupation) FROM OCCUPATIONS GROUP BY occupation ORDER BY numb ASC; '
The problem in question is that I would like to rename COUNT(name)
to numb
through a aliase 'or a pseudo name, but I come across this error.
ERROR 1583 (42000) at line 3: Incorrect parameters in the call to native function 'concat'
Would it be possible to circumvent this problem, ie is it possible to use pseudo names within the function CONCAT
?