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

珠海公司制作网站网站建设流程

珠海公司制作网站,网站建设流程,武胜建设局网站,查询类网站怎么做目录 1.语法 2. 使用场景 select语句 chaining CTEs 链式 union语句 insert into 语句 create table as 语句 前言 Common Table Expressions#xff08;CTE#xff09;#xff1a;公共表达式是一个临时的结果集#xff0c;该结果集是从with子句中指定的查询派生而来…目录 1.语法 2. 使用场景 select语句 chaining CTEs 链式 union语句 insert into 语句 create table as 语句 前言 Common Table ExpressionsCTE公共表达式是一个临时的结果集该结果集是从with子句中指定的查询派生而来的紧跟在select 或 insert关键字之前。CTE可以在 selectinsert  create table as select 等语句中使用。 1.语法 [wtih CommonTableExpression] selectcolumn1,column2, ... from table [where 条件] [group by column] [order by column] [cluster by column| [distribute by column] [sort by column] [limit [offset,] rows]; 2. 使用场景 select语句 with tmp as (selectoid,uid,otime,date_format(otime, yyyy-MM) as dt,oamount,---计算rk的目的是为了获取记录中的第一条row_number() over (partition by uid,date_format(otime, yyyy-MM) order by otime) rkfrom t_order )selectuid,--每个用户一月份的订单数sum(if(dt 2018-01, 1, 0)) as m1_count,--每个用户二月份的订单数sum(if(dt 2018-02, 1, 0)) as m2_count from tmpgroup by uidhaving m1_count 0 and m2_count0; chaining CTEs 链式 with tmp1 as (selectoid,uid,otime,date_format(otime, yyyy-MM) as dt,oamount,---计算rk的目的是为了获取记录中的第一条row_number() over (partition by uid,date_format(otime, yyyy-MM) order by otime) as rkfrom t_order ),tmp2 as(selectuid,--每个用户一月份的订单数sum(if(dt 2018-01, 1, 0)) as m1_count,--每个用户二月份的订单数sum(if(dt 2018-02, 1, 0)) as m2_countfrom tmp1group by uidhaving m1_count 0and m2_count 0) select * from tmp2 limit 1;union语句 with q1 as (select * from student where num 95002),q2 as (select * from student where num 95004) select * from q1 union all select * from q2; insert into 语句 with tmp1 as (selectoid,uid,otime,date_format(otime, yyyy-MM) as dt,oamount,---计算rk的目的是为了获取记录中的第一条row_number() over (partition by uid,date_format(otime, yyyy-MM) order by otime) as rkfrom t_order ),tmp2 as(selectuid,--每个用户一月份的订单数sum(if(dt 2018-01, 1, 0)) as m1_count,--每个用户二月份的订单数sum(if(dt 2018-02, 1, 0)) as m2_countfrom tmp1group by uidhaving m1_count 0and m2_count 0)insert into tmp3 select * from tmp2 limit 10; create table as 语句 --- 从tmp2 表中取10条数据基于此创建表tmp3 create table tmp3 as with tmp1 as (selectoid,uid,otime,date_format(otime, yyyy-MM) as dt,oamount,---计算rk的目的是为了获取记录中的第一条row_number() over (partition by uid,date_format(otime, yyyy-MM) order by otime) as rkfrom t_order ),tmp2 as(selectuid,--每个用户一月份的订单数sum(if(dt 2018-01, 1, 0)) as m1_count,--每个用户二月份的订单数sum(if(dt 2018-02, 1, 0)) as m2_countfrom tmp1group by uidhaving m1_count 0and m2_count 0) select * from tmp2 limit 10;
http://www.w-s-a.com/news/38221/

相关文章:

  • wordpress小说网站模板下载地址百度优化服务
  • 云南网页设计制作seo计费系统源码
  • 屏蔽ip网站吗行业外贸网站建设
  • 河北城乡建设学校网站常州网站建设公司平台
  • 合肥网站建设市场分析网站收录后怎么做排名
  • 湖南企业网站建设如何推广手机网站
  • 网站建设项目经历网站推广服务 商务服务
  • 加强网站的建设福州seo排名外包
  • 做婚庆找什么网站有专门为个人网站做推广的吗
  • 网站搭建要求模板学编程需要英语基础吗
  • 网上如何建网站卖量具净水机企业网站源码
  • 网站推广 软件规划设计公司年终总结
  • 视频网站开发方法微站网建站系统
  • 渐变网站网页界面设计的宗旨是什么
  • 网站排名提升工具免费韶关做网站公司
  • 做网站一个月可以赚多少钱东营市建设工程招标网
  • 网站开发工具阿里云怎么做网站
  • 用html做静态网站成都专业logo设计公司
  • 哪里有免费建站平台233小游戏网页版在线玩
  • 为什么我的网站做不起来网站能搜索到
  • 方又圆网站建设信息流广告二级代理
  • 公司管理网站首页网站后台编辑框不显示
  • aspnet网站开发模板备案 网站建设方案书
  • 营销软件网站wordpress优秀的破解主题
  • 卧龙区网站建设国内漂亮网站欣赏
  • 服装 网站模板 wordpress石家庄做网站的公司有哪些
  • 惠州技术支持网站建设百度怎样注册免费的网站
  • 无锡哪里有做网站的公司泸州网站建设公司
  • 怎么进行网站推广jsp可以做那些小网站
  • 懒人手机网站wordpress修改秒速