这是我的视图创建..它没有返回任何行..
CREATE VIEW TOP AS
(
SELECT
a.USER_ID, a.USER_NAME, a.PASSWORD, a.FIRST_NAME, a.LAST_NAME, a.CONTACT_NUMBER, a.EMERGENCY_NUMBER, a.CITIZEN_SHIP, a.VISA_TYPE,
b.PLACE_CODE, b.PLACE_NAME, b.AIR_AVAILIBILITY, b.TRAIN_AVAILIBILITY, b.ROAD_AVAILIBILITY,
c.CLIENT_ID, c.CLIENT_NAME, c.CLIENT_ADDRESS, c.CLIENT_LOCATION,
d.PROJECT_CODE, d.PROJECT_NAME,
e.REQUEST_ID, e.REQUEST_STATUS, e.REQUEST_FOR, e.REQUEST_MODE, e.REQUEST_TYPE, e.TRAVEL_FROM, e.TRAVEL_TO, e.TRAVEL_DATE, e.TRAVEL_TICKET_BY, e.ASSIGNMENT_PLACE,
e.ASSIGNMENT_COUNTRY, e.TRAVEL_PURPOSE, e.ASSIGNMENT_DURATION, e.ASSIGNMENT_START_DATE, e.ASSIGNMENT_ACCOMODATION_BY, e.ACCOMODATION_BILLABLE, e.TRAVEL_BILLABLE, e.ASSIGNMENT_BILLABLE, e.NSHORE_PROJECT_BILLABLE
FROM USERS a, PLACES b, CLIENTS c, PROJECTS d, REQUESTS e
WHERE
a.USER_ID = e.USER_ID
AND b.PLACE_CODE = e.TRAVEL_FROM
AND b.PLACE_CODE = e.TRAVEL_TO
AND c.CLIENT_ID = d.CLIENT_ID
AND d.PROJECT_CODE = e.PROJECT_CODE
);
我认为问题出在这两行..
AND b.PLACE_CODE = e.TRAVEL_FROM
AND b.PLACE_CODE = e.TRAVEL_TO
我试图不止一次地引用同一张表。对不起,如果我问的是一个非常基本的问题。我对数据库完全陌生。