日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle sql语句

發(fā)布時(shí)間:2025/3/20 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle sql语句 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

--SELECT A COUNT(B) FROM TABLE GROUP BY A HAVING COUNT(B)>2 ?//group by 分組;having 分鐘之后過濾

--and (rrbd.paytype = 1?or rrbd.paytype = 2) //or運(yùn)算要在()里!!!!

select (select rrbd.outordercode
from r_reportbilldetails rrbd, r_reportbilldetails_orders rro
where rrbd.sequen = rro.reportbilldetails_seq
and rro.order_seq = od.sequen
and rownum < 2) as outordercode,
od.sequen as ordercode,
si.sellamount as ysprice,
(select sum(rrbd.outmoney)
from r_reportbilldetails rrbd, r_reportbilldetails_orders rro
where rro.reportbilldetails_seq = rrbd.sequen
and rro.order_seq = od.sequen) as outmoney,
0 as localmoney,
0 as cyprice,
'無' as AA,
0 as BB,
od.customername as customername,
(select e.empname from employee e where e.sequen = od.seller) as empname,
od.remark

from orders od, settleinfo si
where si.order_seq = od.sequen
--是否已付款 0:未付款 1:已付款 2已沖銷 3結(jié)算中
--and si.ispay = 1
and exists
(select *
from r_reportbilldetails_orders rro, r_reportbilldetails rrbd
where rro.order_seq = od.sequen
and rro.reportbilldetails_seq = rrbd.sequen
--訂單結(jié)算狀態(tài) 0:已結(jié)算; 1:結(jié)算中;2:未結(jié)算;空是未處理
and rrbd.paytype=0
and exists (select *
from r_reportdetails rrd
where rrd.sequen = rrbd.reportdetails_seq
--and
))
-----------------------------------------------------------------------------------------
select (select rrbd.outordercode
from r_reportbilldetails rrbd, r_reportbilldetails_orders rro
where rrbd.sequen = rro.reportbilldetails_seq
and rro.order_seq = od.sequen
and rownum < 2) as outordercode,
od.sequen as ordercode,
si.sellamount as ysprice,
(select sum(rrbd.outmoney)
from r_reportbilldetails rrbd, r_reportbilldetails_orders rro
where rro.reportbilldetails_seq = rrbd.sequen
and rro.order_seq = od.sequen
--0 解凍 1凍結(jié)
and rrbd.islock = 0) as outmoney,
(select sum(rrbd.outmoney)
from r_reportbilldetails rrbd, r_reportbilldetails_orders rro
where rro.reportbilldetails_seq = rrbd.sequen
and rro.order_seq = od.sequen
--0 解凍 1凍結(jié)
and rrbd.islock = 1) as localmoney,
0 as cyprice,
'無' as AA,
0 as BB,
od.customername as customername,
(select e.empname from employee e where e.sequen = od.seller) as empname,
od.remark

from orders od, settleinfo si
where si.order_seq = od.sequen
--是否已付款 0:未付款 1:已付款 2已沖銷 3結(jié)算中
--and si.ispay = 0 or si.ispay = 3
and exists
(select *
from r_reportbilldetails_orders rro, r_reportbilldetails rrbd
where rro.order_seq = od.sequen
and rro.reportbilldetails_seq = rrbd.sequen
--訂單結(jié)算狀態(tài) 0:已結(jié)算; 1:結(jié)算中;2:未結(jié)算;空是未處理
and (rrbd.paytype = 1
or rrbd.paytype = 2)
and exists (select *
from r_reportdetails rrd
where rrd.sequen = rrbd.reportdetails_seq
--and
))
-------------------------------------------------------------------------------------------
select
rrbd.outordercode,
'無' as ordercode,
0 as ysprice,
0 as outmoney,
0 as localmoney,
rrbd.outmoney as cyprice,
rrbd.entryvaluetype as AA,
rrbd.receivables as BB,
'無' as customername,
'無' as empname,
rrbd.remark

from r_reportbilldetails rrbd,r_reportdetails rrd
where rrd.sequen=rrbd.reportdetails_seq
--and rrd.reportdate
--and rrd.reportuser=
and not exists (select *
from r_reportbilldetails_orders rro
where rro.reportbilldetails_seq = rrbd.sequen)

?

轉(zhuǎn)載于:https://www.cnblogs.com/flord/p/5817008.html

總結(jié)

以上是生活随笔為你收集整理的oracle sql语句的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。