您的位置:程序门 -> db2 -> 基础类



db2 union问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


db2 union问题[已结贴,结贴人:19999]
发表于:2007-12-12 16:27:40 楼主
初学db2碰到一怪事。
如下sql语句执行正确:

select     id     from   wh_workitem      
union          
  select     id   from   wr_workitem  
)  
然而下面的语句就抱错:
select   id   from

select     id     from   wh_workitem      
union          
  select     id   from   wr_workitem  
)  

错误为:在“id     from   wh_workitem”之后发现意外的标记“end-of-statement”。期望的标记可能包括:“)”。sqlstate=42601
谁知道怎么回事

发表于:2007-12-12 16:35:511楼 得分:100
select       id       from

select           id           from       wh_workitem            
union                    
    select           id       from       wr_workitem    
)     as   temp
发表于:2007-12-12 16:41:062楼 得分:0
多谢东北大胖,我知道原因了。不是sql本身的问题。我的sql被后台程序篡改了。


快速检索

最新资讯
热门点击