Home » SQL & PL/SQL » SQL & PL/SQL » How we will get multiplication of columns with group by clause urgent please...
How we will get multiplication of columns with group by clause urgent please... [message #290] Mon, 04 February 2002 00:44 Go to next message
ramesh
Messages: 123
Registered: August 2000
Senior Member
hi to all,
I have table like ABC with columns as
----------------------------------------
A1 B1 C1 D1
-------------------------------------------
10 10 11 one
10 10 11 one
10 10 11 one
10 10 11 two
10 10 11 two

-------------------------------
when i tried to get like

select D1,A1*B1*C1 as mulpn from ABC group by D1
It is giving error. I know there im not using any aggregate function, but im using group by function.
but how i can get
Multiplication value differentiated by that column D1
means
1100 one
1100 one
1100 one
1100 two
1100 two
thanx in advance
and more..... [message #291 is a reply to message #290] Mon, 04 February 2002 00:52 Go to previous messageGo to next message
ramesh
Messages: 123
Registered: August 2000
Senior Member
hi guys
and i need like
3300 one
2200 two
Re: How we will get multiplication of columns with group by clause urgent please... [message #293 is a reply to message #290] Mon, 04 February 2002 03:16 Go to previous messageGo to next message
Mike
Messages: 417
Registered: September 1998
Senior Member
You can't group without any aggregation function.
Either use ORDER BY insted of GROUP BY or use an aggregation function like
select D1,sum(A1*B1*C1) ... group by D1
Re: and more..... [message #294 is a reply to message #290] Mon, 04 February 2002 03:39 Go to previous message
Mike
Messages: 417
Registered: September 1998
Senior Member
Haven't you tried the example I gave you?
select D1,sum(A1*B1*C1) ... group by D1
Previous Topic: triggers
Next Topic: queries
Goto Forum:
  


Current Time: Fri Apr 26 22:39:53 CDT 2024