Making multiple rows in Table B from one row in Table A.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

A am try to create a query which will read a row in Table A and append it
into Table B as row separate rows.

I am trying to do the following for example:

Turn this row in Table A

T1 C1 B1 S1 60 S2 30 S3 10

Into

Table B

T1 C1 B1 S1 60
T1 C1 B1 S2 30
T1 C1 B1 S3 10

Any suggestions?

Thanks;

Linus Cariboo
 
On Mon, 17 Jan 2005 12:37:03 -0800, "Linus Cariboo" <Linus
A am try to create a query which will read a row in Table A and append it
into Table B as row separate rows.

I am trying to do the following for example:

Turn this row in Table A

T1 C1 B1 S1 60 S2 30 S3 10

Into

Table B

T1 C1 B1 S1 60
T1 C1 B1 S2 30
T1 C1 B1 S3 10

A Normalizing Union Query will do this: assuming your fields are named
T, C, B, S1, V1, S2, V2, S3, V3 it would mean going into the SQL
window and typing (you can't do this in the grid):

SELECT T, C, B, S1, V1 FROM mytable
UNION ALL
SELECT T, C, B, S2, V3 FROM mytable
UNION ALL
SELECT T, C, B, S3, V3 FROM mytable

Base an Append query upon this stored UNION query.

John W. Vinson[MVP]
 

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

Back
Top