0
SELECT b.*
FROM buses b,
     bus_stations bs,
     starts st,
     stops_at sa
WHERE st.station_no = ( SELECT station_id 
                        FROM bus_stations 
                        WHERE station_name = "golden mile_Regina"
                      )
  AND sa.station_no = ( SELECT station_id 
                        FROM bus_stations 
                        WHERE station_name = 'westmount_edmonton'
                      )
ORDER BY DATE;

1 Answer 1

1

You can't use double quotes with strings - use single ones, i.e.

WHERE station_name = 'golden mile_Regina'

By the way, are you sure of spelling & letter size? Is it really mixed case, with underscores? Just asking.

Furthermore, you're ordering by DATE - that won't work either, you can't use DATE as a column name (unless you enclose it into double quotes, but I certainly wouldn't recommend that). Have a look at the following example (stupid, yes - setting date to be a number, but I used it just to emphasize that DATE can't be used as a column name):

SQL> create table test (date number);
create table test (date number)
                   *
ERROR at line 1:
ORA-00904: : invalid identifier

Once you fix that, you'll get unexpected result as there are 4 tables in the FROM clause, but they aren't joined with one another, so that will be a nice Cartesian product.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.