Re: Merging two queries and I get syntax errors - Mailing list pgsql-novice

From Ibrahim Shaame
Subject Re: Merging two queries and I get syntax errors
Date
Msg-id CAJOWwD7NvHZTaMUJiJ9=yH4gpyTHkc1n9t6cN7Z0Ox00PbNgrg@mail.gmail.com
Whole thread
In response to Re: Merging two queries and I get syntax errors  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-novice
Thank you David for the quick response. I placed the new column two columns before and it works. I just can't understand why it does not when added to the end. But anyway it works where it is now.
Thank you again.

Ibrahim Shaame 

On Sat, Mar 21, 2026 at 5:42 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Saturday, March 21, 2026, Ibrahim Shaame <ishaame@gmail.com> wrote:

FROM michango2 a, majina2 b 

WHERE a.mlipaji = b.namba 


Here it does not work and I get the message:

ERROR:  syntax error at or near "a"
LINE 1: ...1 AS miezi_deni FROM michango2 a, majina2 b WHERE a.mlipaji

and it point at a.mlipaji


Nothing seems obviously wrong which leads me to suspect some nonprinting character issues.  Try writing/rebuilding the query in small increments until you get the error again then manually retype the last added chunk.  Or just take the opportunity to use a more conventional explicit ANSI join syntax and move the join condition to the ON clause, getting rid of the where clause with the apparent issue.

David J.

pgsql-novice by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Merging two queries and I get syntax errors
Next
From: Yaten Dhingra
Date:
Subject: Re: Interested in contributing to PostgreSQL documentation and technical writing