-
SQL Query Help Needed
Hello,
I am kinda newbie to the SQL so please excuse if the question is dumb, but I don't know hot to figure it out.
I am working with an Oracle database (11g).
It all comes down to this:
I have a table that is:
column1 varchar2(10)
column2 number(5,2)
column3 varchar2(5)
I have to create a query that will group results by column1 (easy), sums the column2 values for identical column1 values and (here's the tricky part) to concatenate the texts in column3.
Something like:
column1 column2 column3
a__________1_________x
b__________2_________y
c__________3_________z
a__________15________w
I need the report to be something like:
column1 column2 column3
a_______1+15(16)____xw
select column1, sum(column2), column3 from table group by column1; -> will not work due to the restriction regarding the group by clause and aggregation functions. Using a subquery doesn't seem to do it, as I cannot concatenate the values in different rows in column3.
Does anyone know how this can be achieved?
Thanks a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|