You have the same column name in both tables. Add aliases.
CREATE VIEW VW_ROUTE AS
SELECT ROUTE_NAME
, FARE
, DESTINATION
, S.ROUTE_ID
, STOP_NAME
, TERMINUS
, NUMBER_OF_STOPS
FROM STOPS S
LEFT JOIN ROUTE R
ON S.ROUTE_ID = R.ROUTE_ID
WHERE NUMBER_OF_STOPS > ('1');
It is good practice to use aliases in all cases to avoid ambiguity.
source
share