Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need hellp to split out a column of data into 3 fields

Status
Not open for further replies.

Tamania1

Computer
Dec 2, 2005
1
Hello everyone

I have some data I need help in splitting out.

I have a column - for argument sake shows as A, B and C and I have a second column that has figures attached to this data.

I need to sum values where column 1 = A then create another column for values = B and so on. Can anyone assit me with this please?

Thanks for you help.

Tax
 
Replies continue below

Recommended for you

select distinct
(select sum(column2) from <table> where column1='A') AS A,
(select sum(column2) from <table> where column1='B') AS B,
(select sum(column2) from <table> where column1='C') AS C
from <table>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor