Buen día compañeros, hoy creando una consulta para mi aplicacion, al hacer un select anidado dentro de otro surgio el error 1064 de MySQL, y en realidad no entiendo que esta mal en mi consulta mi motor de base de datos es la 4.1.22, aqui les dejo mi consulta para ver si alguein me logra decir que esta mal en la misma
SELECT distinct(`EQU-ID`),SELECT count( `EQU-PTS` ) AS PTS, count( `EQU-GLS` ) AS GLS, count( `EQU-NGL` ) AS NGL
FROM `REGPAR` AS x where x.`TOR-ID` = y.`TOR-ID` and x.`EQU-ID`= y.`EQU-ID` FROM `REGPAR` as y
Ete es el mesnaje de phpMyAdmin:
Cita: consulta SQL: Documentación
SELECT DISTINCT (
`EQU-ID`
),
SELECT count( `EQU-PTS` ) AS PTS, count( `EQU-GLS` ) AS GLS, count( `EQU-NGL` ) AS NGL
FROM `REGPAR` AS x
WHERE x.`TOR-ID` = y.`TOR-ID`
AND x.`EQU-ID` = y.`EQU-ID`
FROM `REGPAR` AS y
MySQL ha dicho: Documentación
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT count( `EQU-PTS` ) AS PTS, count( `EQU-GLS` ) AS GLS, count( `EQU-NGL` ) ' at line 1