문제

Hi I am trying to do the following query. Basically im trying to count all musicians that exist that are born in 1990.

SELECT COUNT(MusicianID), 
COUNT(DISTINCT CASE WHEN year(DateOfBirth)=1990)
FROM Musician
도움이 되었습니까?

해결책

try this

 SELECT COUNT(MusicianID) As allmusicians
 FROM Musician
 WHERE year(DateOfBirth) = 1990

다른 팁

SELECT COUNT(MusicianID)
FROM Musician
WHERE YEAR(DateOfBirth)=1990
Select count(musicianid)
from musician
Where year(date of birth) = 1990

This will work:

SELECT COUNT(MusicianID)
FROM Musician
WHERE YEAR(DateOfBirth)=1990
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top