Domanda

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
È stato utile?

Soluzione

try this

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

Altri suggerimenti

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top