Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to do the SELECT?
SELECT * FROM my_table
WHERE odr_no IN
(SELECT col_1 FROM (SELECT odr_no col_1, SUM(pay_rate) col_2 FROM my_table GROUP BY odr_no) WHERE col_2 = 100);
select * from contrat
where code_org_2 in
(select aa from
(select code_org_2 aa,sum(taux_majoration_reg_eloignee) bb from contrat
group by code_org_2)
where bb>80)
Violin a écrit dans le message
<372117d9.2992633_at_news.twsc.pouchen.com.tw>...
>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 Fri Apr 23 1999 - 22:12:07 CDT