query help

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sebs
Forum Commoner
Posts: 97
Joined: Tue Sep 20, 2005 10:13 am

query help

Post by sebs »

I have in table "TEL" all telefones,names,adresses,City,Region ->many fields inserted in it
I want to move distinct City and Region in another table "Region".
can you help m with the select query?
it should be something like this but don't work:

Code: Select all

insert into Region(City,Region) values((select distinct City,Region from TEL))
in this the subquery returns many values and I can put in insert only at a time.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sebs
Forum Commoner
Posts: 97
Joined: Tue Sep 20, 2005 10:13 am

Post by sebs »

simple!I should figgered that out by myself but I was blind and maybe sometimes outside help is great!Thanks..
Post Reply