3 ms·
No love for JOIN ... USING in this thread eh SELECT t.passenger_name, t.ticket_no, bp.seat_no FROM Flights f JOIN Ticket
by wild_egg 2y ago
No love for JOIN ... USING in this thread eh
SELECT
t.passenger_name,
t.ticket_no,
bp.seat_no
FROM Flights f
JOIN Ticket_flights tf USING (flight_id),
JOIN Tickets t USING (ticket_no),
JOIN Boarding_pass bp USING (ticket_no, flight_id)
WHERE f.arrival_airport = 'OVB';
- dhc02 2y agoI like this and haven't used it before. Thanks for sharing.
- goodlinks 2y agoNever seen this before, always thought it would be tasty sugar though.. thanks for making me aware of it!
- Suppafly 2y agoI've never seen USING before, is that available in mssql or just the various open source ones?
- santiagobasulto 2y agoFor me, idk why, it feels too "ORACLE-ly". I stopped using Oracle after administering an 9i until ~2010 and I never want to go back But yes, `USING` is convenient and pleasant to the eyes.
- yen223 2y ago`using` works really well, but only when the two column names are the same. That's why it's not a bad idea to include the table name in the id column name: `flight.flight_id` instead of `flight.id`.