我可以在Music Brainz数据库(musicbrainz web site)
中进行此查询找到最古老的意大利语版本(结果必须包括发布名称,发布日期和国家/地区名称(即意大利))
我想某些字段是null
,所以我使用该函数来合并以使用假设值设置其字段(对于9999年,对于第13个月,对于第32天)
这是查询代码:
select release.name as nomeRelease, release_country.date_year as anno, release_country.date_month as mese, release_country.date_day as giorno, area.name as paese
from release left join release_country on release.id = release_country.release
join country_area on release_country.country = country_area.area
join area on area.id = country_area.area
where coalesce(release_country.date_day, 32) =
(
select min(coalesce(release_country.date_day, 32))
from release left join release_country on release.id = release_country.release
join country_area on release_country.country = country_area.area
join area on area.id = country_area.area
where area.name = 'Italy' and release_country.date_month =
(
select min(coalesce(release_country.date_month, 13))
from release left join release_country on release.id = release_country.release
join country_area on release_country.country = country_area.area
join area on area.id = country_area.area
where area.name = 'Italy' and release_country.date_year =
(
select min(coalesce(release_country.date_year, 9999))
from release left join release_country on release.id = release_country.release
join country_area on release_country.country = country_area.area
join area on area.id = country_area.area
where area.name = 'Italy'
)
)
)
查看数据库的行应该是1983年发布的版本,但是当我运行查询时因此我没有行