我想要这个输出:
Ashely(P)
Christeen(P)
Jane(A)
Jenny(D)
Julia(A)
Ketty(P)
Maria(A)
Meera(S)
Priya(S)
Samantha(D)
There are a total of 2 doctors.
There are a total of 2 singers.
There are a total of 3 actors.
There are a total of 3 professors.
这是一个查询:
select concat(name,'(',left(occupation,1),')')
from occupations
order by name;
select concat('There are a total of ', count(*),' ', occupation,'s') from occupations
group by occupation
order by count(occupation);
每次运行它时,我都会得到以下输出:
Aamina(D)
Ashley(P)
Belvet(P)
Britney(P)
Christeen(S)
Eve(A)
Jane(S)
Jennifer(A)
Jenny(S)
Julia(D)
Ketty(A)
Kristeen(S)
Maria(P)
Meera(P)
Naomi(P)
Priya(D)
Priyanka(P)
Samantha(A)
concat('There are a total of ', count(*),' ', occupation,'s')
There are a total of 3 Doctors
There are a total of 4 Actors
There are a total of 4 Singers
There are a total of 7 Professors
我做错了什么?
1条答案
按热度按时间nqwrtyyt1#
感谢您的帮助!它现在可以工作了。我已经将查询更改为: