SELECT c1.matricula, GLength(c1.geometry) as longitud
FROM carreteras c1
WHERE GLength(c1.geometry) = (
SELECT GLength(c2.geometry)
FROM carreteras c2
);
CodePudding user response:
When the subquery returns more than one row, you have to use IN
:
SELECT c1.matricula, GLength(c1.geometry) as longitude
FROM carreteras c1
WHERE GLength(c1.geometry) IN (
SELECT GLength(c2.geometry)
FROM carreteras c2
);
or ANY
:
SELECT c1.matricula, GLength(c1.geometry) as longitude
FROM carreteras c1
WHERE GLength(c1.geometry) = ANY (
SELECT GLength(c2.geometry)
FROM carreteras c2
);