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

9

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
2
Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest