当前位置:网站首页>Daily sql-seek the sum of successful investments in 2016
Daily sql-seek the sum of successful investments in 2016
2022-08-11 07:13:00 【Eating too much sugar will not gain weight】
Daily sql-find the sum of successful investments in 2016
Background
Conditions for successful investment in 2016:
1. The insured amount in 2015 is at least the same as the amount insured by another insured in 2015
2. The coordinates of this insured must be unique.
DDL
CREATE TABLE IF NOT EXISTS insurance (PID INTEGER(11), TIV_2015 NUMERIC(15,2), TIV_2016 NUMERIC(15,2), LAT NUMERIC(5,2), LON NUMERIC(5,2span>) );insert into insurance (PID, TIV_2015, TIV_2016, LAT, LON) values (1, 10, 5, 10, 10);insert into insurance (PID, TIV_2015, TIV_2016, LAT, LON) values (2, 20,20, 20, 20);insert into insurance (PID, TIV_2015, TIV_2016, LAT, LON) values (3, 10, 30, 20, 20span>);insert into insurance (PID, TIV_2015, TIV_2016, LAT, LON) values (4,10, 40, 40, 40);
sql
SELECT SUM(insurance.TIV_2016) AS TIV_2016FROM insuranceWHERE insurance.TIV_2015 IN( SELECT TIV_2015 FROM insurance GROUP BY TIV_2015 HAVING COUNT(*) > 1 )AND CONCAT(LAT, LON) IN( SELECT CONCAT(LAT, LON) FROM insurance GROUP BY LAT , LON HAVING COUNT(*) = 1 );
边栏推荐
猜你喜欢
HCIP experiments (pap, chap, HDLC, MGRE, RIP)
OA项目之会议通知(查询&是否参会&反馈详情)
Solve win10 installed portal v13 / v15 asked repeatedly to restart problem.
mmdetection的安装和训练、测试didi数据集的步骤(含结果)
实现通用的、高性能排序和快排优化
抖音API接口
HCIP BGP built adjacent experiment
智能合约 ——— app评分合约
《Generative Adversarial Networks》
Top20 bracket matching
随机推荐
每日sql -用户两天留存率
智能合约 ——— app评分合约
HCIP--交换基础
淘宝sku API 接口(PHP示例)
《Generative Adversarial Networks》
什么是Inductive learning和Transductive learning
详解BLEU的原理和计算
uboot sets the default bootdelay
pytorch调整模型学习率
window7开启远程桌面功能
CLUSTER DAY04 (Block Storage Use Cases, Distributed File Systems, Object Storage)
SATA、SAS、SSD三种硬盘存储性能数据
矩阵分析——矩阵分解
损失函数——交叉熵
【LeetCode】851.喧闹与富有(思路+题解)
拼多多API接口(附上我的可用API)
OA project meeting notice (query & whether attending & feedback for details)
HCIP OSPF/MGRE Comprehensive Experiment
SECURITY DAY04 (Prometheus server, Prometheus monitored terminal, Grafana, monitoring database)
核方法 Kernel method