Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

148
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda