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
相关解决方案
- 什么是搜狗指数 Sogou Rank
- 施用 JSC 做 Wilcoxon signed-rank test
- 请Proc 下SQL 话语能用 oracle 函数ROW_NUMBER()和 rank()吗
- Oracle开发课题之:分析函数2(Rank, Dense_rank, row_number) (转载)
- [转]Oracle开发课题之:分析函数2(Rank, Dense_rank, row_number)
- 好用的排行函数~ROW_NUMBER(),RANK(),DENSE_RANK() 三兄弟
- Rank()与DENSE_RANK()的差别
- SQL Server2008 排序函数施用RowNumber ,Rank,Dense_Rank ,Ntile
- SQL2005四个排行函数(row_number、rank、dense_rank和ntile)的比较
- 标题4:MySQL-Rank Scores
- Oracle分析函数总结(2) - 排序 - rank,dense_rank,row_number,first,first_value,last,last_value,lag,lead
- PAT甲级-1012 The Best Rank (25分)
- 解决ValueError: Shape must be rank 1 but is rank 0 for ‘bn_conv1/Reshape_4’ (op: ‘Reshape’) with input
- HDOJ 1718 Rank
- PAT甲级 - 1012 The Best Rank (25 分)
- hdu 1811 Rank of Tetris(并查集+拓扑排序)
- Wilcoxon signed-rank test and U-statistics
- PAT-1012 The Best Rank
- Acwing -- Rank Weekly N0.44
- Rank 比拼
- POJ - 2153 Rank List(map)
- Leetcode 1366. Rank Teams by Votes (python+cpp)
- Leetcode 1615. Maximal Network Rank (python)
- Mysql rank 计算排名:
- 排序入门(2)----PAT-A1012 The Best Rank
- Oracle Rank() Over()
- PAT Advanced1012 The Best Rank(排序,模拟)
- UVALive Problem 7073 Song Jiang's rank list(排序)——2014ACM/ICPC亚洲区广州站
- HOJ 1704 Rank(floyd传递闭包)
- HOJ 2643 Rank(第二类斯特林数,裸题)