Oracle create table as select with count max condition

后端 未结 2 1711
心在旅途
心在旅途 2020-12-31 16:08

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         


        
相关标签:
2条回答
  • 2020-12-31 16:15

    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.

    0 讨论(0)
  • 2020-12-31 16:34

    Oracle issues the "Failed: Warning: execution completed with warning" in a CREATE TABLE statement whenever you use a function on a column with NULLs. This often happens when you use a CASE WHEN or DECODE and don't use a default to take care of the NULLs (e.g., ELSE 0). This is also the solution to the same problem stated on https://forums.oracle.com/forums/thread.jspa?threadID=723332.

    To avoid problems: make sure you don't use a function (e.g., max, sum) on a column with NULLs in a CREATE TABLE AS.

    0 讨论(0)
提交回复
热议问题