嗨,我有以下代码
SELECT entertainer_id, entertainer_groupname FROM casestudy_entertainer INNER JOIN casestudy_availability ON casestudy_entertainer.entertainer_id = CASESTUDY_AVAILABILITY.AVAILABILITY_ENTERTAINERID INNER JOIN casestudy_calendardates ON CASESTUDY_AVAILABILITY.AVAILIBILITY_CALENDARDATEID = casestudy_calendardates.calendar_Id WHERE entertainer_type = '&Entertainer_TYPE' AND casestudy_calendardates.calendar_date = '&Event_date'
而且我似乎无法弄清运行此程序时不喜欢的原因。它给了我以下错误
ORA-00904:“ CASESTUDY_AVAILIBILITY”。“ AVAILIBILITY_CALENDARDATEID”:无效的标识符00904。00000-“%s:无效的标识符” 原因: 操作:行错误:7列:4
我的所有表都正确无误。唯一的事情是我到目前为止还没有数据,这可能是问题吗?
您应该尝试使用小写的表/列标识符(例如from/inner join子句中的标识符):
from
inner join
SELECT entertainer_id, entertainer_groupname FROM casestudy_entertainer INNER JOIN casestudy_availability ON casestudy_entertainer.entertainer_id = casestudy_availability.availability_entertainerid INNER JOIN casestudy_calendardates ON casestudy_availability.availibility_calendardateid = casestudy_calendardates.calendar_id WHERE entertainer_type = '&Entertainer_TYPE' AND casestudy_calendardates.calendar_date = '&Event_date'