Subselects to populate a table

From: "Chris Boget" <chris(at)wild(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Subselects to populate a table
Date: 2003-01-03 13:25:45
Message-ID: 003701c2b32b$9f521ec0$8c01a8c0@ENTROPY
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I've read through the docs and I couldn't find many examples of using
subselects. I could find out and read all about what they were, but not
many examples. If someone could point to a page that does show this,
I'd be ever so appreciative!
Anyways, I'm redoing a table I imported from MySQL (as part of my
conversion to PG from MySQL) and I'm having problems with this. The
error I'm getting is that it says you can't select more than one column.
Why? Is there another way to do what I'm trying? Here is my query:

INSERT INTO "cards_type_temp"
( "card_game", "card_name", "card_table", "record_num" )
VALUES
( 'Vtes', ( SELECT "card_name", "card_type", "record_num" FROM "cards_type" ));

Any help or insight would be great!

Chris

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Erwan DUROSELLE 2003-01-03 13:39:21 Rp. : Subselects to populate a table
Previous Message Andrew McMillan 2003-01-03 10:36:37 Re: How to determine the type of a column