Oracle创建表作为select with count max条件 [英] Oracle create table as select with count max condition

查看:201
本文介绍了Oracle创建表作为select with count max条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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开发人员说我:


在命令中的第7行开始出错:[...]错误报告:

SQL命令:create table

失败:警告:执行完成时出现警告


,但创建表和


解决方案

旧版本的SQL Developer有一个错误,使它们在 CREATE TABLE 后发出类似的警告:请参阅此OTN论坛帖子



由于表创建并填充正确的数据, c $ c> CREATE TABLE 语句是正确的。如果你想确定,请尝试执行SQL * Plus中的语句。


I've got an Oracle problem, here is my select:

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);

this query gives me one generic error with no explanation. SQL Developer say me:

"Error starting at line 7 in command: [...] Error report:
SQL Command: create table
Failed: Warning: execution completed with warning"

but create the table and the data inside seems to be correct.

Some hints?

解决方案

Older versions of SQL Developer have a bug which makes them issue a similar warning after a CREATE TABLE: see this OTN Forums post.

Since the table is created and populated with the correct data, the CREATE TABLE statement is correct. If you want to be sure, try executing the statement from SQL*Plus.

这篇关于Oracle创建表作为select with count max条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆