Skip to content
Advertisement

syntax error at or near “JOIN” for postgresql

I am trying to join two tables, and for some reason I keeping getting:

ERROR: syntax error at or near “JOIN”

My code is:

SELECT
    c.visit,
    d.cake
FROM 
    customer c, 
INNER JOIN desert d 
    ON c.visit = d.visit
LIMIT 10;

Advertisement

Answer

The comma is unnecessary:

SELECT
    c.visit,
    d.cake
FROM 
    customer c -- here
INNER JOIN desert d 
    ON c.visit = d.visit
LIMIT 10;
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement