Oracle使用count max condition创建表为select
发布时间:2020-12-12 13:06:45 所属栏目:百科 来源:网络整理
导读:我有一个Oracle问题,这是我的选择: create table new_table as selectidprod as product_id,descr as descriptionfrom old_table p where updateNum = (select max(updateNum) from old_table pp where pp.idprod = p.idprod); 此查询给出了一个通用错误,没
我有一个Oracle问题,这是我的选择:
create table new_table as select idprod as product_id,descr as description from old_table p where updateNum = (select max(updateNum) from old_table pp where pp.idprod = p.idprod); 此查询给出了一个通用错误,没有解释. SQL Developer说我:
但是创建表并且里面的数据似乎是正确的. 一些提示? 无论何时在具有NULL的列上使用函数,Oracle都会在CREATE TABLE语句中发出“失败:警告:执行完成且出现警告”.当您使用CASE WHEN或DECODE并且不使用默认值来处理NULL(例如,ELSE 0)时,通常会发生这种情况.这也是 https://forums.oracle.com/forums/thread.jspa?threadID=723332中所述相同问题的解决方案.为避免出现问题:请确保在CREATE TABLE AS中的NULL列上不使用函数(例如,max,sum). (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- iPhone SDK – NSStreamEventHasBytesAvailable / appendBy
- ruby-on-rails – Rails – Heroku – Postgres – 不以明文
- C STL优先级队列使用什么堆结构?
- ruby-on-rails – Ruby On Rails,Redis :: CommandError:E
- c# – 从桌面开发转向Web开发
- Postgresql的示例数据库
- py 正则表达式 List的使用, cxfreeze打包
- Holer实现外网访问内网Oracle数据库
- VB6.0 读写excel表格/dat文件并保存
- c# – MVC2 Html.ValidationMessageFor:添加htmlAttribute