database questions in sql

后端 未结 2 1409

The following query is in SQL:

SELECT r.reservation_no, f.flight_no, r.departure_date,
       f.departure_time, f.duration
  FROM flights f, reservations r
         


        
相关标签:
2条回答
  • 2021-01-15 09:41
    String query = "SELECT r.reservation_no, f.flight_no, r.departure_date, f.departure_time, f.duration FROM flights f, reservations r WHERE f.flight_no=r.flight_no AND r.customer_ssn="?" ";
    
    PreparedStatement ps = connection.prepareStatement(query);
    ps.setString(1, customer_ssn);
    result = ps.executeQuery();
    
    0 讨论(0)
  • 2021-01-15 09:41

    If i have understood your question correctly, then in the place of ??? you can have either the column name or the column index number.

    0 讨论(0)
提交回复
热议问题