How to Create Table from Select Statement in Oracle 11G [Duplicate]
I Want to Create Table from Another Table I Tried Below Code Create Table as Tbl_01 as Select A. Col1 C1, A. Col2 C2, Max(A. Col3 C3) from Tbl a Where Flag= 2...
I want to CREATE table from another table I tried below code
CREATE TABLE AS tbl_01
As
SELECT a.col1 c1, a.col2 c2, MAX(a.col3 c3)
FROM tbl a
WHERE flag= 2
GROUP BY col1, col2
This query run, but When I am going to expand column in datatabse explorer it gives error Conversion from type DBNULL to type Integer is not valid
1 Answer
Put alias outside braces in max function and try. Also you use as twice. COrrected that.
CREATE TABLE tbl_01
As
SELECT a.col1 c1, a.col2 c2, MAX(a.col3) c3
FROM tbl a
WHERE flag= 2
GROUP BY col1, col2