473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to display one column values to multiple column values?

input is like
Type,Financial_yr,Month,Amount
T1 ,2010 ,April,1000
T1 ,2010 ,May ,2000
T1 ,2010 ,June ,3000
T2 ,2011 ,May ,1500
T2 ,2011 ,July ,3500
T2 ,2011 ,Aug ,4000
My output wiil be like
Type,Financial_yr,M1 ,M2 ,M3 ,Total_amount
T1 ,2010 ,1000 ,2000,3000,6000
T2 ,2011 ,1500 ,3500,4000,9000
Mar 11 '11 #1

✓ answered by debasisdas

You need to read the following article for details.

article.

3 2323
Rabbit
12,516 Expert Mod 8TB
You could use a pivot if oracle supports that. Otherwise you'll have to use a bunch of case statements.
Mar 11 '11 #2
debasisdas
8,127 Expert 4TB
You need to read the following article for details.

article.
Mar 13 '11 #3
amitpatel66
2,367 Expert 2GB
Thats called pivot. Which version of database are you using?
Mar 20 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
4
by: cwwilly | last post by:
Hello, Thanks for taking a look at this! Problem: I'm trying to pass multiple dynamic values between a slaveform and a masterform. The problem I'm having is on the slaveform I loop through...
4
by: Bill Todd | last post by:
Is there any way to display the RowState of each row in a computed column in the DataTable? -- Bill
5
by: Marina | last post by:
Hi, Let's say I bind the same column to multiple properties of one control (or even to the same property of several controls). If a user changes the value of the property in one control - I...
2
by: Sam | last post by:
Hi all I have a database table that has multiple column primary key and every thing looks fine when I load it in the datagrid web control. The problem is that the datagrid web control can only...
1
by: dan_williams | last post by:
Is it possible to pass multiple discrete values to a report document so that I can export it to PDF? I've managed to perform the following code to display a Crystal Report Viewer ok, but i want...
8
by: aleksandar.ristovski | last post by:
Hello all, I have been thinking about a possible extension to C/C++ syntax. The current syntax allows declaring a function that returns a value: int foo(); however, if I were to return...
2
by: ssjay1981 | last post by:
Hello All, I am new to ms-access, i have a table with values as mentioned below. Each of these table are given with a list of Look up values, in order to narrow down the list of values under...
7
nev
by: nev | last post by:
i declared 2 datatables: dim dtt1 as datatable = ds.datatable1 dim dtt2 as datatable = ds.datatable2 dtt1 has firstname, lastname columns dtt2 has firstname column when i filter dtt1 by...
2
by: ezhar | last post by:
int ctr = dataGridView1.CurrentCellAddress.Y; string str = dataGridView1.Value.ToString(); Form1 frm = (Form1)Application.OpenForms; frm.textBox1.Text = str; I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.