当前位置:网站首页>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 );
边栏推荐
猜你喜欢
SECURITY DAY06 ( iptables firewall, filter table control, extended matching, typical application of nat table)
《Generative Adversarial Networks》
[损失函数]——均方差
pytorch下tensorboard可视化深坑
使用路由器DDNS功能+动态公网IP实现外网访问(花生壳)
MySQl进阶之索引结构
八股文之mysql
arcgis填坑_1
HCIP-生成树(802.1D ,标准生成树/802.1W : RSTP 快速生成树/802.1S : MST 多生成树)
FusionCompute8.0.0 实验(2)虚拟机创建
随机推荐
torch.cat()使用方法
查看内核版本和发行版版本
淘宝sku API 接口(PHP示例)
MySQL之函数
核方法 Kernel method
OA项目之待开会议&历史会议&所有会议
radix-4 FFT 原理和C语言代码实现
每日sql:求好友申请通过率
抖音分享口令url API工具
Eight-legged text of mysql
HCIP BGP built adjacent experiment
iptables的状态
华为防火墙-3-应用过滤
Class definition, class inheritance, and the use of super
华为防火墙-4-安全策略
detectron2,手把手教你训练mask_rcnn
HCIP OSPF动态路由协议
HCIP MPLS/BGP综合实验
从mask-rcnn到shp
快速了解集成学习