--- Steve Lefevre <lefevre.10@osu.edu> wrote:
> Hello all -
>
> I'm trying to do a JOIN within a table. In MySQL, I would do
>
> SELECT main_table.field, join_table.field
> FROM main_table
> LEFT JOIN main_table AS join_table ON join_table.id = main_table.parent_id
PostgreSQL conforms to the SQL standard when it comes to giving alias names to a single table and
doesn't use MySQL's vendor specific extension:
SELECT Instance1.field, Instance2.field
FROM Main_table AS Instance1
LEFT OUTER JOIN Main_table AS Instance2
ON Instance1.id = Instance2.id;
Here I am showing two alias names, but you could reduce this query to use only one if you wanted.
Regards,
Richard Broersma Jr.