Eu identei o seu código, dê uma olhada como fica:

select
        the_geom
from
(
        SELECT
                the_geom
        FROM
                arcos
        JOIN
        (
                SELECT
                        *
                FROM
                        shortest_path
                ('
                        SELECT
                                id2 as id,
                                source::int4 AS source,
                                target::int4 AS target,
                                length*estado_actual.custo AS cost
                        FROM
                                arcos,
                                estado_actual
                        where
                                arcos.estado_a = estado_actual.id_ea',
                                438,
                                489,
                                false,
                                false
                )
        ) AS rota
        ON
                arcos.id2 = rota.edge_id
) -- qual o alias dessa sub-query?

Conseguiu identificar o problema?

2012/6/26 Pedro Costa <[email protected]>:
> Olá pessoal,
>
> Estou a tentar fazer uma query como esta:
>
>
> select the_geom from
>
> (SELECT the_geom
>  FROM arcos
>   JOIN
>   (
> SELECT * FROM shortest_path('
>  SELECT id2 as id,
>  source::int4 AS source,
>   target::int4 AS target,
>    length*estado_actual.custo AS cost
>    FROM arcos, estado_actual
>    where arcos.estado_a = estado_actual.id_ea',
>    438,489,false,false)) AS rota
>   ON
>   arcos.id2 = rota.edge_id)
>
>  using unique id2
>
>
> Mas devolve-me o seguinte erro:
>
> ERROR:  subquery in FROM must have an alias
> LINE 4: (SELECT the_geom
>
>
> Será que podem ajudar a resolver?
>
> Obrigado
>
>
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral



-- 
Lucas Lima
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a