sql查询错误#Syntax

时间:2018-05-12 00:57:29

标签: mysql sql sql-server-2008 error-handling phpmyadmin

This is the image MY QUERY AND TABLES/COLUMN I USED FOR THE QUERY

Select heros.Nom,heros.Prenom
From (
    SELECT  ID_Heros, 
            COUNT(ID_ville) AS nmbr,
            (
                SELECT * 
                FROM etape 
                RIGHT JOIN participe ON etape.ID_Expedition= pqrticipe.ID_Expedition
            ) as sub1 
    GROUP BY ID_Heros 
    ORDER BY COUNT(ID_ville) LIMIT 1
) As sub2 
INNER JOIN heros On sub2.ID_Heros = heros.ID_Héros

问题: 查询用于:最旅行的英雄(最不同的城市交叉)

1064 - 'GROUP BY ID_Heros ORDER BY COUNT(city_ID)LIMIT 1附近的语法错误as sub2

INNER JOIN hero 'at line 5

为什么我有这个错误? (我怎么能解决它)

我认为这是2个计数,但我不确定

0 个答案:

没有答案