sql:关于Oracle的update from语句
2009-10-13 12:58
441 查看
[align=left] 还是带有SQL Server的习惯,在Oracle中经常使用update from结构,事实上Oracle中是不存在from语句的。
[/align]
update hek_om_pop_lines_all
2 set quantity_2 = quantity_1
3 from hek_om_pop_lines_all l, hek_om_pop_headers_all h, hek_om_user_ctl_v ctl
4 where l.header_id = h.header_id
5 and h.sold_to_org_id = ctl.customer_id
6 and h.flow_status = 'enter'
7 and to_char(h.creation_date,'yyyymmdd') >= &p_start_date
8 and to_char(h.creation_date,'yyyymmdd') <= &p_end_date
9 and ctl.user_id = 1115 -- apps.fnd_profile.VALUE('user_id')
10 and application = 'POP';
[align=left] [/align]
[align=left]error:ORA-00933:SQL Command not properly ended[/align]
[align=left] [/align]
update hek_om_pop_lines_all
2set quantity_2 = quantity_1
3where header_id in (select h.header_id
4 from hek_om_pop_headers_all h, hek_om_user_ctl_v ctl
5 where h.flow_status = 'enter'
6 and to_char(h.creation_date,'yyyymmdd') >= &p_start_date
7 and to_char(h.creation_date,'yyyymmdd') <= &p_end_date
8 and ctl.user_id = 1115 -- apps.fnd_profile.VALUE('user_id')
9 and application = 'POP'
10 and h.sold_to_org_id = ctl.customer_id);
[/align]
update hek_om_pop_lines_all
2 set quantity_2 = quantity_1
3 from hek_om_pop_lines_all l, hek_om_pop_headers_all h, hek_om_user_ctl_v ctl
4 where l.header_id = h.header_id
5 and h.sold_to_org_id = ctl.customer_id
6 and h.flow_status = 'enter'
7 and to_char(h.creation_date,'yyyymmdd') >= &p_start_date
8 and to_char(h.creation_date,'yyyymmdd') <= &p_end_date
9 and ctl.user_id = 1115 -- apps.fnd_profile.VALUE('user_id')
10 and application = 'POP';
[align=left] [/align]
[align=left]error:ORA-00933:SQL Command not properly ended[/align]
[align=left] [/align]
update hek_om_pop_lines_all
2set quantity_2 = quantity_1
3where header_id in (select h.header_id
4 from hek_om_pop_headers_all h, hek_om_user_ctl_v ctl
5 where h.flow_status = 'enter'
6 and to_char(h.creation_date,'yyyymmdd') >= &p_start_date
7 and to_char(h.creation_date,'yyyymmdd') <= &p_end_date
8 and ctl.user_id = 1115 -- apps.fnd_profile.VALUE('user_id')
9 and application = 'POP'
10 and h.sold_to_org_id = ctl.customer_id);
相关文章推荐
- 关于oracle的sql语句中 for update 的使用,以及存在的问题
- Oracle SQL语句之UPDATE
- 关于oracle sql语句查询时 表名和字段名要加双引号的问题详解
- 关于执行Oracle下Sql语句中遇到的特殊字符问题解决办法。
- 关于oracle sql语句查询时表名和字段名要加双引号的问题详解
- [转]关于Oracle 树形SQL语句
- 开博第一天占点thomas光:关于oracle update 语句和trigger
- Oracle关联更新语法(T-SQL中的update...from)
- Oracle 删除重复数据只留一条 查询及删除重复记录的SQL语句 1、查找表中多余的重复记录,重复记录是根据单个字段(Id)来判断 select * from 表 wher
- 移动文章分类的sql语句,查询并更新同一个表的方法 You can't specify target table 'news_articles' for update in FROM clause
- Related to Oracle SQL 关于优化,SQL语句的共享[笔记]
- oracle中关于查看角色与角色间权限的差异的SQL语句(转)
- 关于Oracle与SqlServer、Access中获取所有字段、主键、外键的sql语句
- 关于oracle sql语句查询时 表名和字段名要加双引號的问题具体解释
- Oracle中5个核心Sql语句的基本构造:Select、Insert、Update、Delete和Merge
- 关于导出oracle多个表的建表语句DLL,生成.sql语句。
- 关于Oracle与SqlServer中获取所有字段、主键、外键的sql语句
- 关于Hibernate利用@DynamicInsert和@DynamicUpdate生成动态SQL语句 -- 如何提高效率
- 关于sql中update语句响应条数为0的情况
- oracle关于查询空间使用情况的几个sql语句