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

海珠做网站要多少钱高端营销型网站建设

海珠做网站要多少钱,高端营销型网站建设,3d网站建设方案,wordpress二级菜单添加链接目录 1.语法 2. 使用场景 select语句 chaining CTEs 链式 union语句 insert into 语句 create table as 语句 前言 Common Table Expressions(CTE):公共表达式是一个临时的结果集,该结果集是从with子句中指定的查询派生而来…

目录

1.语法

 2. 使用场景

select语句

chaining CTEs 链式

union语句

insert into 语句

create table as 语句

前言

   Common Table Expressions(CTE):公共表达式是一个临时的结果集,该结果集是从with子句中指定的查询派生而来的,紧跟在select 或 insert关键字之前。CTE可以在 select,insert,  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_count=0;
  • 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.shuangfujiaoyu.com/news/58728.html

相关文章:

  • 网站的月度流量统计报告怎么做百度pc端提升排名
  • 灌云网站制作推广方案范例
  • 开拓网站建设公司今日时政新闻
  • 电子商务网站方案如何分析百度指数
  • 常州溧阳网站建设网站seo检测工具
  • 杭州网站建设zj net打开全网搜索
  • 上海优化网站关键词seo链接优化建议
  • 一级a做爰全过程网站qq引流推广软件免费
  • 做网站大公司还是小公司百度如何免费推广
  • 哪个网站做新中式seo搜索引擎优化主要做什么
  • 国内知名的包装设计公司搜索引擎优化排名案例
  • 网站素材图片线上销售的方法和技巧
  • 打不开wordpress站点提升关键词排名seo软件
  • 网站建设柒金手指花总11百度搜索引擎入口登录
  • 换友网站国外搜索引擎优化
  • 衢州哪里有做网站的公司4000-262-品牌推广方案ppt
  • 自己做电影网站网上国网app
  • 阿里云备案增加网站学网络与新媒体后悔死了
  • 北京html5网站建设百度手机助手网页
  • 想建设个网站怎么赚钱今日热点新闻事件摘抄
  • 查看公司信息的网站百度应用市场官网
  • 做期货要看哪些网站石家庄网站建设培训
  • 网站开发 创造收益天津seo渠道代理
  • 宜昌做网站公司河北seo技术
  • wordpress 幻灯片长春网站优化平台
  • wordpress自定义404页面模板城关网站seo
  • 注册公司代理费用标准广州网站建设方案优化
  • 做色情游戏的网站有哪些拼多多关键词排名在哪里看
  • 东莞市做阀门的网站自己怎样推广呢
  • 网站建设 2018拉新推广渠道