-1

The extraction table returns the below with a

SELECT * FROM track_raw LIMIT 5;

     title          |    artist     |     album     | album_id | count | rating | len 

The table I want to input this data into looks like this;

id | title | len | rating | count | album_id 

I'm using this line of code;

INSERT INTO track (title, len, rating, count, album_id) SELECT (title, len, rating, count, album_id) FROM track_raw; 

For which I'm receiving the following error..

ERROR: INSERT has more target columns than expressions

LINE 1: INSERT INTO track (title, len, rating, count, album_id) SELE...

So far I've been unable to identify why.

1 Answers1

1

Remove the parentheses around the SELECT list, so that the result becomes multiple columns rather than a single composite record.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263