(oracle)创建视图出错

lx442653099 2010-04-16 08:16:38
/*==============================================================*/
/* View: V_AIM_CLIENT */
/*==============================================================*/
create or replace view V_AIM_CLIENT as
select c.id, c.name, c.client_id as client_temi_id, c.client_level as client_temi_category_id, d.name as client_temi_category_name from t_client c join t_data_dict d on c.client_level=d.id where is_client='Y'
union
select t.id, t.name, t.temi_client_id as client_temi_id, t.temi_client_category as client_temi_category_id, d.name as client_temi_category_name from t_temi_client t join t_data_dict d on t.temi_client_category=d.id where is_temi_client='Y'
with read only;

comment on table V_AIM_CLIENT is
'需方客户,包括分销商和终端客户';

上面是我创建视图的sql语句,但是却出现了如下错误提示:
select c.id, c.name, c.client_id as client_temi_id, c.client_level as client_temi_category_id, d
.name as client_temi_category_name from t_client c join t_data_dict d on c.client_level=d.id whe
re is_client='Y'

*
第 2 行出现错误:
ORA-00942: 表或视图不存在


comment on table V_AIM_CLIENT is
*
第 1 行出现错误:
ORA-00942: 表或视图不存在


请问是怎么回事?我检查了很多遍,那些表都存在的。
...全文
89 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hjywqt 2010-12-18
  • 打赏
  • 举报
回复
SQL> create or replace view V_AIM_CLIENT as
2 select c.id,c.name,c.client_id as client_teni_id,c.client_level as client_temi_category_id,d.na
me as client_temi_category_name
3 from t_client c join t_data_dict d on c.client_level=d.id
4 where is_client ='Y'
5
SQL>
SQL>
SQL>
SQL> union all
SP2-0042: 未知命令"union all" -- 其余行忽略。
SQL> select t.id,t.name,t.temi_client_id as client_teni_id,t.temi_client_category as client_temi_cat
egory_id,d.name as client_temi_category_name from t_temi_client t join t_data_dict d on t.temi_clien
t_category=d.id where is_temi_client='Y'
2 with read only;
with read only
*
ERROR 位于第 2 行:
ORA-00933: SQL 命令未正确结束

我用的是oracle 9i 是什么出错了,请高手帮一个

50,542

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧