1.
select name
from customer
where referee_id != 2 or referee_id is null;
2.
select name
from customer
where ifnull(referee_id,0)!=2;
#两种写法
#ifnull:第一个值为null就返回第二个值0,第一个值不为null就返回第一个值referee_id,然后在比较。
#!= 不包括null
# Write your MySQL query statement below
select round(sum(TIV_2016), 2) as tiv_2016
from insurance
where 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
group by concat(LAT, LON)
having count(*) = 1
);
#连接 LAT 和 LON 为一个整体,以表示坐标信息