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

147
Vistas
Simple SELECT statement query with error

It is a simple SELECT statement where i pick data from two tables

SELECT 
    bookingid, customerid, flightid, numseats, 
    passengerid, firstname, surname, passportno,  
    nationality, dobdate
FROM 
    flightbooking, passenger;

I get an error:

ERROR: syntax error at or near "SELECT"
LINE 9: SELECT bookingid, customerid, flightid, numseats, passengeri... ^

I am using PG Admin 4.

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

0

You have two tables so you should use inner join please check this Mysql SELECTIONG FROM TWO TABLES

over 4 years ago · Santiago Trujillo Denunciar

0

To troubleshoot, start by changing your query from this:

SELECT bookingid
, customerid
, flightid
, numseats
, passengerid
, firstname
, surname
, passportno
, nationality
, dobdate

FROM flightbooking, passenger;

to this:

SELECT 1 bookingid
/*
, customerid
, flightid
, numseats
, passengerid
, firstname
, surname
, passportno
, nationality
, dobdate
*/

FROM flightbooking join passenger on 1 =2;

If it runs successfully, change select 1 bookingid to select bookingid. If that runs successfully, uncomment 1 field at a time until you get an error. The last field you uncomment would be the cause.

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