;with scope
as
(
select
'both' as channel,
customer_id,
date,
sum(spend) as Sum_2,
iif(count(channel)<2,0,count(channel)) as tot_channel
from dbo.spend
group by customer_id,
date
),Isolate
as(
select . 1point3acres
date,
channel,
max(iif(tot_channel <2,0, sum_2)) as tot_spend,
max(tot_channel) as count1. 1point3acres.com
-baidu 1point3acres
from scope.1point3acres
group by date, channel. Waral dи,
),FINAL
as(. From 1point 3acres bbs
select * from isolate
union
select
date,. 1point3acres.com
channel,
sum(spend) as tot_spend,. check 1point3acres for more.
count(customer_id) as count1
from dbo.spend
group by date, channel,customer_id
)
select ..
*
from FINAL
order by date, case when channel ='both' then'9'
when channel = 'mobile' then '1'
when channel = 'destop' then '2'
end ASC
Q2 in Mysql. 1point3acres
-baidu 1point3acres
CREATE VIEW career AS
SELECT member_id, group_concat(company_name ORDER BY year_start SEPARATOR '-') AS member_career
FROM job. ----
GROUP BY member_id;
# 1)
SELECT count(*)
FROM career
WHERE member_career LIKE '%Microsoft%Google%';
# 2) . 1point 3 acres
SELECT count(*) .google иFROM career
WHERE member_career LIKE '%MicrosoftGoogle%';