当前位置: 代码迷 >> SQL >> SQL command not properly ended异常
  详细解决方案

SQL command not properly ended异常

热度:47   发布时间:2016-05-05 12:49:07.0
SQL command not properly ended错误
点击右边红色标题查看本文完整版:SQL command not properly ended错误

SQL command not properly ended

在pl/sql developer上运行这样一条sql语句:
select t1.borrow_id as borrow_id,
t2.El_Name as resource_name,
t2.El_LabelID as resource_labelid,
t3.user_name as user_name,
t3.user_organization as user_unit,
t1.Borrow_Date as resource_date,
t1.Borrow_ID as objid
from INTEL.CS_EleBorrowInfo t1,
intel.CS_ElectronicInfo t2,
cs_userinfo t3
where t1.Borrow_ObjectID = t2.El_ID
and t1.Borrow_UserID = t3.user_id
and t1.Borrow_Date > to_date( '2007-9-4 ', 'yyyy-mm-dd ')
and t1.Borrow_Date < to_date( '2007-9-5 ', 'yyyy-mm-dd ')
order by t1.Borrow_Date desc -- 错误出现在这里
union
select t1.borrow_id as borrow_id,
t2.Film_Name as resource_name,
t2.Film_LabelID as resource_labelid,
t3.user_name as user_name,
t3.user_organization as user_unit,
t1.Borrow_Date as resource_date,
t1.Borrow_ID as objid
from INTEL.CS_FilmBorrowInfo t1, intel.CS_FilmInfo t2, cs_userinfo t3
where t1.Borrow_ObjectID = t2.Film_ID
and t1.Borrow_UserID = t3.user_id
and t1.Borrow_Date > to_date( '2007-9-4 ', 'yyyy-mm-dd ')
and t1.Borrow_Date < to_date( '2007-9-5 ', 'yyyy-mm-dd ')
order by t1.Borrow_Date desc
union
select t1.borrow_id as borrow_id,
t2.ReliefMap_Name as resource_name,
t2.ReliefMap_LabelID as resource_labelid,
t3.user_name as user_name,
t3.user_organization as user_unit,
t1.Borrow_Date as resource_date,
t1.Borrow_ID as objid
from INTEL.CS_MapBorrowInfo t1,
intel.CS_ReliefMapInfo t2,
cs_userinfo t3
where t1.Borrow_ObjectID = t2.ReliefMap_ID
and t1.Borrow_UserID = t3.user_id
and t1.Borrow_Date > to_date( '2007-9-4 ', 'yyyy-mm-dd ')
and t1.Borrow_Date < to_date( '2007-9-5 ', 'yyyy-mm-dd ')
order by t1.Borrow_Date desc
union
select t1.borrow_id as borrow_id,
t2.Book_Name as resource_name,
t2.Book_LabelID as resource_labelid,
t3.user_name as user_name,     

  相关解决方案