select mt1.company as company, mt1.POLICY_HOLDER as policyHolderName, mt1.POLICY_HOLDER_id as policyHolderId, mt1.recognizee as insuredName, mt1.recognizee_id as insuredCusId, mt1.age as age, mt1.effective_date as validateDate, mt2.name as productName, mt1.maxpay as maxpay, mt1.currency as productCurrency, mt2.amount as amount, mt1.totalpay as modePremium, mt1.insure_status as policyStatus, mt1.tid as tid, mt1.create_id as agentNumber from gl_trade_policy mt1 inner join gl_tradel_product mt2 on mt1.tid = mt2.tradep_id and mt1.status = '1' and mt2.status = '1' inner join gl_cus_customer mt3 on mt3.tid = mt1.recognizee_id inner join gl_cus_customer mt4 on mt4.tid = mt1.POLICY_HOLDER_idwhere mt2.name = (select min(nt2.name) from gl_trade_policy nt1 inner join gl_tradel_product nt2 on nt1.tid = nt2.tradep_id group by nt1.tid having nt1.tid = mt1.tid) union select null, t2.policy_holder_name as policyHolderName, t2.customer_id as policyHolderId, t2.insured_name as insuredName, t3.customer_id as insuredCusId, t3.insured_age as age, t2.validate_date as validateDate, t4.product_name as productName, t3.payment_period as maxpay, t4.product_currency as productCurrency, t3.amount as amount, t2.MODE_PREMIUM as modePremium, t2.policy_status as policyStatus, t2.tid as tid, t5.agent_number as agentNumber from gl_cus_accpect_manager t5 inner join gl_cus_accept_insurance t2 on t5.policy_code = t2.policy_code inner join gl_cus_polagent t3 on t2.policy_code = t3.policy_code inner join gl_cus_accpect_product t4 on t3.product_code = t4.product_codewhere t3.coverage_sql = (select min(bt2.coverage_sql) from gl_cus_accept_insurance bt1 inner join gl_cus_polagent bt2 on bt1.policy_code = bt2.policy_code group by bt1.policy_code having bt1.policy_code = t2.policy_code)
详细解决方案
用普普通通sql代替rank函数
热度:94 发布时间:2016-05-05 09:59:29.0
相关解决方案
- 请Proc 下SQL 话语能用 oracle 函数ROW_NUMBER()和 rank()吗
- [转]Oracle开发课题之:分析函数2(Rank, Dense_rank, row_number)
- 好用的排行函数~ROW_NUMBER(),RANK(),DENSE_RANK() 三兄弟
- Rank()与DENSE_RANK()的差别
- SQL2005四个排行函数(row_number、rank、dense_rank和ntile)的比较
- 标题4:MySQL-Rank Scores
- PAT甲级 - 1012 The Best Rank (25 分)
- hdu 1811 Rank of Tetris(并查集+拓扑排序)
- PAT-1012 The Best Rank
- 排序入门(2)----PAT-A1012 The Best Rank
- UVALive Problem 7073 Song Jiang's rank list(排序)——2014ACM/ICPC亚洲区广州站
- 拓扑排序 hdu1811 Rank of Tetris
- pat 甲级 1012 The Best Rank(25)
- Oracle rank() over 与 row_number() over
- hdu-1811-Rank of Tetris-并查集+拓扑排序
- pat 1012 The Best Rank
- HDU 1811 Rank of Tetris (并查集+拓扑排序)
- 排名函数(ROW_NUMBER、RANK、DENSE_RANK)及OVER子句
- PAT甲级1012 The Best Rank