Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

403
Vistas
Don't know why the error is always there, inner join issue?
SELECT bookingid, customer.customerid, flightid, numseats, firstname, surname, billingadress, email
FROM flightbooking, leadcustoemr;
INNER JOIN customerid ON flighbooking.customerid = leadcustomer.customerid;

I get a syntax error at or near "SELECT" when i run it in PG Admin 4, where is the problem, i think it is in the inner join, but unsure.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You have a semicolon after leadcustomer (which seems to have a typo itself) - that ends your select statement and the inner join isn't included (in addition, the inner join isn't using the correct table names). Also in the select you are using a column from the customer table (and that table is not joined at all).

I think you are trying to join the flightbooking and leadcustomer tables with the Inner Join and not actually trying to add in a third table. I edited your query here:

SELECT bookingid, flightbooking.customerid, flightid, numseats,
   firstname, surname, billingadress, email
FROM flightbooking
INNER JOIN leadcustomer ON (flightbooking.customerid = leadcustomer.customerid);
over 4 years ago · Santiago Trujillo Denunciar

0

The syntax for join has two forms according to this: https://www.postgresql.org/docs/current/static/tutorial-join.html

SELECT *
FROM A, B
WHERE A.id = B.id;

So rewriting the query according to above syntax:

 SELECT bookingid, customer.customerid, flightid, numseats, firstname, 
 surname, billingadress, email
 FROM flightbooking, leadcustomer
 WHERE flightbooking.customerid= leadcustomer.customerid

more standard syntax is:

SELECT *
FROM A
INNER JOIN B
ON A.id = B.id

So rewriting the query results in:

SELECT bookingid, customer.customerid, flightid, numseats, firstname, surname, 
billingadress, email
FROM flightbooking
INNER JOIN  leadcustomer 
ON flighbooking.customerid = leadcustomer.customerid;`

and you could use aliases to make it shorter:

SELECT bookingid, customer.customerid, flightid, numseats, firstname, surname, 
billingadress, email
FROM flightbooking fb
INNER JOIN  leadcustomer  lc
ON fb.customerid = lc.customerid;
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda