SELECT
count(*)
FROM
N_RACE
INNER JOIN
N_UMA_RACE AS FIRST
ON
FIRST.Year = N_RACE.Year
AND
FIRST.MonthDay = N_RACE.MonthDay
AND
FIRST.JyoCD = N_RACE.JyoCD
AND
FIRST.RaceNum = N_RACE.RaceNum
AND
FIRST.KakuteiJyuni = "01"
INNER JOIN
N_UMA_RACE AS SECOND
ON
SECOND.Year = N_RACE.Year
AND
SECOND.MonthDay = N_RACE.MonthDay
AND
SECOND.JyoCD = N_RACE.JyoCD
AND
SECOND.RaceNum = N_RACE.RaceNum
AND
SECOND.KakuteiJyuni = "02"
INNER JOIN
N_UMA_RACE AS THIRD
ON
THIRD.Year = N_RACE.Year
AND
THIRD.MonthDay = N_RACE.MonthDay
AND
THIRD.JyoCD = N_RACE.JyoCD
AND
THIRD.RaceNum = N_RACE.RaceNum
AND
THIRD.KakuteiJyuni = "02"
WHERE
N_RACE.JyoCD IN("01", "02", "03", "04", "05", "06", "07", "08", "09", "10")
AND
N_RACE.Year IN("2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021")
AND
N_RACE.TorokuTosu = "18"
AND
FIRST.Ninki IN("01", "02", "03")
AND
SECOND.Ninki IN("01", "02", "03")
AND
THIRD.Ninki IN("01", "02", "03")
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme