我希望根据日期将两个表合并在一起。其中一个表中的日期值可以多次出现,但是我需要根据日期的唯一实例进行匹配。这是我无法使用的内容:
select idt.Incident_DateCopy, wt.weather_main
from incidentdatatwo as idt left join weather as wt on
(select distinct(Incident_DateCopy) from incidentdata) as idate = wt.dt_iso
...
如果不起作用,请向您发送表模式
SELECT idt.Incident_DateCopy, wt.weather_main ,
(SELECT DISTINCT(Incident_DateCopy) FROM incidentdata) AS idate
FROM incidentdatatwo AS idt LEFT JOIN weather AS wt ON
HAVING idate = wt.dt_iso