create temporary table test (id int);
truncate table test ;
insert into test
select 1 from (
select
(case (select count(1) num from actual_day_shop_sale ) when 0 then 1 end) can_insert
) as aa
where can_insert=1
select * from test
truncate table test ;
insert into test
select 1 from (
select
(case (select count(1) num from actual_day_shop_sale ) when 0 then 1 end) can_insert
) as aa
where can_insert=1
select * from test