当前位置: 首页 > news >正文

招聘网站建设的项目描述公共建设工程中心网站

招聘网站建设的项目描述,公共建设工程中心网站,郑州高端网站建设怎么样,公司企业邮箱申请目录标题618. 学生地理信息报告--完全不会的新题型1097. 游戏玩法分析 V - 重难点1127. 用户购买平台--难且不会618. 学生地理信息报告–完全不会的新题型 max()函数的功效:(‘jack’, null, null)中得出‘jack’,(nul…

目录标题

      • 618. 学生地理信息报告--完全不会的新题型
      • 1097. 游戏玩法分析 V - 重难点
      • 1127. 用户购买平台--难且不会

618. 学生地理信息报告–完全不会的新题型

在这里插入图片描述
在这里插入图片描述
max()函数的功效:(‘jack’, null, null)中得出‘jack’,(null,null)中得出null。 min()函数也可以。
窗口 先打标签再group by再case when:

select
max(case when continent = 'America' then name else null end) as America,
max(case when continent = 'Asia' then name else null end)as Asia,
max(case when continent = 'Europe' then name else null end) as Europe
from 
(select *, row_number() over(partition by continent order by name) rk
from student) t
group by rk

1097. 游戏玩法分析 V - 重难点

题型:读题

在这里插入图片描述
解答:
看的评论区大佬的解答
由题目可知,需要计算以下几个值:

  1. 每个玩家第一个登录日
  2. 第一个登陆日之后有没有登录
  3. 第一个登录日的玩家的数量,第一个登录日的第二天登录玩家的数量

方法1:建临时表后,再和原表左联,通过datediff(activity.event_date, t1.first_date) = 1限制次日登录

  1. 每个玩家第一个登录日,作为 t1 表
select player_id,min(event_date) as first_date
from activity group by player_id;
  1. 将 t1 表和 activity 左连
select * from t1 
left join activity 
on t1.player_id = activity.player_id 
and datediff(activity.event_date, t1.first_date) = 1;

datediff(大日期,小日期) --日期之差

  1. 左联之后的表,再按照第一个登陆日进行分组

完整:

with t as
(select player_id,min(event_date) as first_date
from Activity
group by player_id)select t.first_date install_dt,count(t.player_id) installs,
round(count(a.event_date)/count(t.first_date),2) day1_retention
from  t 
left join Activity a on t.player_id = a.player_idand datediff(a.event_date, t.first_date) = 1
group by t.first_date

方法2:使用了窗口函数代替了分组。

  1. 使用窗口函数建临时表
select player_id,event_date,min(event_date) over(partition by player_id) as first_date
from activity;

t1表:
在这里插入图片描述

  1. 查询 t1 ,按照 first_date 进行分组
with t1 as(select player_id,event_date,min(event_date) over(partition by player_id) as first_datefrom activity
)selectfirst_date as install_dt,count(distinct player_id) as installs,round(sum(if(date_add(first_date, interval 1 day) = event_date, 1, 0)) / count(distinct player_id),2) as day1_retention
from  t1 group by first_date;

date_add(first_date, interval 1 day) = event_date

1127. 用户购买平台–难且不会

在这里插入图片描述
在这里插入图片描述
评论区大佬的思路:

  1. 统计每天不同平台的消费额,类似于其他的购物指标消费额一般都是以用户和时间作为分组
    这道题的分组是按用户和时间天为分组条件
    group by user_id,spend_date
  2. if(count(distinct platform)=2,‘both’,platform)
  3. 第二步构造列中如果当日没有同时使用’mobile’和’desktop’购买的用户,就无法输出’both’字段
    因此我们需要构造出一个固定输出三个字段 ‘both’ ‘desktop’ ‘mobile’ 的列
(
select 'desktop' as platform union
select 'mobile' as platform union
select 'both' as platform
) b

完整:

select spend_date,b.platform,
sum(if(a.platform=b.platform,amount,0)) as total_amount,
count(if(a.platform=b.platform,1,null)) as total_users
from(select spend_date,user_id,if(count(distinct platform)=2,'both',platform) as platform,sum(amount) as amountfrom spendinggroup by user_id,spend_date
) a,(select 'desktop' as platform unionselect 'mobile' as platform unionselect 'both' as platform
) b
group by spend_date,platform
http://www.yayakq.cn/news/940502/

相关文章:

  • 制作一个视频网站长春企业网站制作优化
  • dw网站开发教程杭州建设工程招标网新址
  • 哪个网站可以做app界面成都百度百科
  • 门户网站开发报价单如何做网站性能优化
  • 网站开发的研究计划书steam交易链接怎么看
  • 电子商务网站建设与管理考卷苏州有什么好玩的地方吗
  • 网站建设的公司资质哪个不是网站开发工具
  • 网站建设改革情况汇报长沙做网站的故事
  • 网站建设公司有前途吗岳阳建设商城网站公司
  • 专做宠物的网站网页打不开的一个解决方法
  • 盐城做企业网站的价格经典设计作品
  • 网站建设 公司新闻免费下载ppt模板的网站有哪些
  • 赣州建网站wordpress fonts
  • 珠海网站快速排名提升做淘宝客没有网站怎么做
  • 网站开发环境写什么一级注册安全工程师
  • 文登区建设局网站免费个人建站系统
  • 400网站推广公司网站开发与维护
  • 广州建网站有哪些室内设计公司企业简介
  • 网站过期后多长时间不续费就完了wordpress字体大小
  • 网站业务流程设计可以申请做cpa广告的网站
  • 做服装辅料一般什么网站找客户网站搭建空间
  • 深圳集团网站建设企业在百度上怎么发布信息
  • 药品招商网站大全地方房产网站APP如何做
  • 客户网站建设完成后需要什么装修网站官网
  • 觉得自己做的网站土怎么办国外专门做杂志的共享网站
  • 安徽省城乡建设网站怎样提交网站地图
  • 做网站送白酒个人内网网站建设
  • 南宁市做公司网站wordpress基础
  • 大型网站都怎么做推广中国招标网官网首页
  • 网站开发费属于研发费用吗网站方案范文