字段列表中的未知列

dgsult0t  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(531)

**结案。**此问题不可复制或由打字错误引起。它目前不接受答案。
**想改进这个问题吗?**更新问题,使其成为堆栈溢出的主题。

两年前关门了。
改进这个问题
你好,我在mysql中尝试自连接时经常遇到这个错误。我以前用post-gres-sql以不同的方式做过这件事,但是我对mysql还不熟悉。实际上,我有一组列,我想使用sum聚合这些列,然后我想在完成聚合后将其与其他列(在同一个表中)连接起来。我不断得到以下错误
'错误代码:1054。“字段列表”中的未知列“m”
以下是我的sql代码:

SELECT
    e.IncidentDate,
    e.City,
    e.Tract,
    SUM(e.InvolvedPedesrian) as InvolvedPedesrian,
    SUM(e.InvolvedCyclist) as InvolvedCyclist,
    SUM(e.InvolvedMotorist) as InvolvedMotorist,
    SUM(e.TotalInjuries) as TotalInjures,
    SUM(e.TotalDeaths) as TotalDeaths,
    SUM(e.TotalCasualties) as TotalCasualties,
    SUM(e.TotalCyclistInjuries) as TotalCyclistInjuries,
    SUM(e.TotalCyclistCasualties) as TotalCyclistCasualties,
    SUM(e.TotalPedestrianInjuries) as TotalPedestrianInjuries,
    SUM(e.TotalPedestrianDeaths) as TotalPedestrianDeaths,
    SUM(e.TotalPedestrianCasualties) as TotalPedestrianCasualties,
    m.B01003_001, m.B02001_002, m.B02001_003, m.B02001_004, 
    m.B02001_005,
    m.B02001_006, m.B02001_007, m.B02001_008, m.B03002_012, 
    m.B01001_002, m.B01001_026,
    m.B01002_001, m.B01002_002, m.B01002_003, m.B20002_001, 
    m.B20002_002, m.B20002_003,
    m.B08135_001, m.B08006_001, m.B08006_002, m.B08006_003, 
    m.B08006_004, m.B08006_008,
    m.B08006_014, m.B08006_015, m.B08006_016, m.B08006_018, 
    m.B08006_019, m.B08006_020, m.B08006_021,
    m.B08006_025, m.B08006_031, m.B08006_032, m.B08006_033, 
    m.B08006_035, m.B08006_036, m.B08006_037,
    m.B08006_038, m.B08006_042, m.B08006_048, m.B08006_049, 
    m.B08006_050, m.B08121_001, m.B08121_002,
    m.B08121_003, m.B08121_004, m.B08121_005, m.B08121_006, 
    m.B09008_002, m.B09008_004, m.B09008_005,
    m.B09010_002, m.B09010_003, m.B09010_004, m.B09010_005, 
    m.B09010_006, m.B09010_007, m.B09019_002,
    m,B09019_003, m.B09019_005, m.B09019_006, m.B09019_007, 
    m.B09019_008, m.B09019_024, m.B09019_038,
    m.B15003_002, m.B15003_016, m.B15003_017, m.B15003_018, 
    m.B15003_020, m.B15003_022, m.B15003_023,
    m.B15003_025, m.B16001_002, m.B23025_004, m.B23025_005, 
    m.B17020_002, m.B08201_002, m.B19013_001,
    m.B19013A_001, m.B19013B_001
FROM 
    master  e
        INNER JOIN 
    master m on m.Tract  = e.Tract 
GROUP BY e.IncidentDate, e.City, e.Tract
Limit 5;
f0brbegy

f0brbegy1#

m,B09019_003

你需要一个句点而不是逗号。

相关问题