How I can put name on subquery’s output, instead of ?column??
The SELECT‘s output is:
._______.__________.__________.
|__id___|_?column?_|_?column?_|
|_31886_|____12____|____13____|
What I want is:
._______.__________.__________.
|__id___|___ages___|_validate_|
|_31886_|____12____|____13____|
What my SELECT look like:
SELECT g.id,
(select dt from pcdhidro where nomepcd=31886 order by datahora asc limit 1),
(select dt from pcdhidro_2003_96 where nomepcd=31886)
FROM gestpcd_2 g
WHERE g.tipo = 'HIDRO' and g.id = 31886
So in your case: