duplicate rows in a table based on the value in a column

B

bookworm

i have a table with rows of data. One of the column header is Country within
which there are values like USA, Canada etc and also Asia, Europe etc. I have
a seperate list which breaks out the countries in Asia, Europe etc. Is there
a way for me to replace the values for Asia etc with the individual
countries, so that the row for Asia is replaced with an identical row for
each country within Asia?
 
O

Ofer

Assuming that the list of countries within the continent.
You can create a query where you join both tables, inner join, by the
continent field, display all the fields from the first table including the
name of the country from the second table.
The result of the query should display the duplicates records, but with a
different country, change the query to append query to append all the records
to table1
 
O

Ofer

I didnt finish the first line, it will work only if the the list of countries
within the continent is in a seperate table
 
B

bookworm

Many thanks. How do I make it replace the continents list though, this adds
to it. Now, can I take this new list, add a value to another column and add
to the original table?
Also how can I make the primary key for the new appended records begin with
a specific #?
 
O

Ofer

You can change the select query to create table query, create a new table,
define the key and the order you would like, and then you can rename it to
the name of the old table without the countries, or not, just use a new table
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top