CREATE TABLE. [5506] Column names must be specified when SELECT list contains an unnamed expression.

Database
Enthusiast

CREATE TABLE. [5506] Column names must be specified when SELECT list contains an unnamed expression.

Posting text removed based on formal request from Owner of the associated Intelectual Property.

2 REPLIES
Enthusiast

Re: CREATE TABLE. [5506] Column names must be specified when SELECT list contains an unnamed expression.

Hi,

You need to name all the columns where the column is being created using some expression or function. For example [edited at request of IP owner] must be given an explicit name. Otherwise you can use the following syntax to rename the columns

Create Table tablename(Comma separated Col_list) AS

(SELECT Col_list from Tablename);

Khurram
Enthusiast

Re: CREATE TABLE. [5506] Column names must be specified when SELECT list contains an unnamed expression.

Thank you, I was so focused on getting the syntax for the expression I missed adding the explicit names to the other two "sum" statements.  After adding the explicit names the query ran fine.  Thanks for your help!