0

I'm a bit rusty on my SQL and Access so just wanted some help.

I have a set of data like the below in Access

C1 C2 C3 
1  A  C
2  B  D
3  B  E  

From this data I wanted run a SQL query that will combine columns 2 and 3 but also retain the information in column 1 alongside it. I've illustrated this below

C1 C2
1  A 
2  B
3  B
1  C
2  D
3  E 

I've run a sql query using a union syntax to combine columns 1 and 2 already but can't figure out how to include the column 1 data as well.

Any help on this would be greatly appreciated.

Thanks,
Shan

1 Answer 1

1

Don't know access but if it supports union something like:

select c1, c2 as c2 from T
union all
select c1, c3 as c2 from T

should work. If c2 and c3 always differ, or if you are not interested in duplicates union can be used instead of union all

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.