Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!