Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to do the SELECT?
select odr_no,sum(pay_rate),qty,price
from MY_TABLE
group by odr_no,qty,price
having sum(pay_rate)=100
That will return one row for each odr_no with a sum(pay_rate) of 100
-Dean
On 24 Apr 1999 02:18:08 GMT, violin.hsiao_at_mail.pouchen.com.tw (Violin) wrote:
>Hello all,
>Need help again.
>If I have a table and here are the rows:
>
>ODR_NO PAY_RATE QTY PRICE
>----------------------------------------------------
>A0001 10 5 10000
>A0001 20 5 10000
>A0001 70 5 10000
>B0001 30 10 2000
>B0001 50 10 2000
>C0001 40 8 15000
>C0001 60 8 15000
>D0001 80 1 20000
>
>I want to select where SUM(PAY_RATE) = 100 ,
>How to return the results?
>
>ODR_NO PAY_RATE QTY PRICE
>----------------------------------------------------
>A0001 10 5 10000
>A0001 20 5 10000
>A0001 70 5 10000
>C0001 40 8 15000
>C0001 60 8 15000
>
>Thanks for any tips.
>
>Violin.
>violin.hsiao_at_mail.pouchen.com.tw
Received on Sat Apr 24 1999 - 17:27:00 CDT
![]() |
![]() |