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

重庆最近新闻做搜狗网站优化排

重庆最近新闻,做搜狗网站优化排,建筑装修,徐州网页设计培训自我愚见#xff0c;望有错指出改之。/*SQL 学习*//*数据定义语言(DDL)#xff1a;create、drop、alter*//*数据操作语言(DML)#xff1a;insert、update、delete*//*数据查询语言(DQL)#xff1a;select*//*数据控制语言(DCL)#xff1a;grant、remove、commit、rollback…自我愚见望有错指出改之。/*SQL 学习*//*数据定义语言(DDL)create、drop、alter*//*数据操作语言(DML)insert、update、delete*//*数据查询语言(DQL)select*//*数据控制语言(DCL)grant、remove、commit、rollback*//*SELECT语句*/proc sqlselect ...from..where..group by..having..根据groupby得到子数据集order by..;/*EX1*/data a;set sashelp.class;where a70;run;proc sql;select sexFfrom sashelp.classfit;quit;proc sql;select sexFfrom sashelp.classfit;quit; /*s输出的结果是111000.... 表示如果是符合sex‘F’的就是1*//*利用SQL创建新表*/proc sql;create tablenew(表的名字) asselect * (代表选择全部)from ..;quit;/*利用列创建新变量*/proc sql;create tablenew asselect*,weight/height as ratio /*这个蛮有意思ratio是新的列名*/format5.2 label体重身高比fromsashelp.classfit;quit;/*利用SQL进行数据统计 类似Procsummary */proc sql;create tablenew1 asselect min(age) as youngest,max(age) as oldest,mean(height) as h format5.1from sashelp.classfit;quit;/*等同于下面的语句*/proc summary datasashelp.classfit;var age height;output outnew2(drop_type_ _freq_)/*删去两个列的统计量*/min(age)yougestmax(age)oldgestmean(height)h; /*记住分号别忘了*/run;/*利用SQL进行分组统计 加入了groupby*/proc sql;create tablenew3 asselect sex,min(age) as youngest,max(age) as oldest,mean(height) as h format5.1from sashelp.classfitgroup bysex;quit;/*等同于下面的语句*/proc summary datasashelp.classfit;class sex;var age height;output outnew4(drop_type_ _freq_)min(age)yougestmax(age)oldgestmean(height)h;run;/*根据条件语句创建数据集CASE WHEN ..THEN*/proc sql;create tablenew5 asselect name,age,sex,case whenage11 then zoowhen sexF then manelse [none]endas nenene /*是对新的 zoo man 这列命名*/from new;quit;/*利用where创建子数据集 简单*/proc sql;create tablenew6 asselect *from newwhere sexF;quit;/*利用having从句代替where从句*/proc sql;create tablenew7 asselect*from newgroup bysex,agehaving sexF;quit;/**必记having只能在groupby 之后 where必须在其之前**//*利用distinct剔除重复记录 **这个有陷阱见笔记*/proc sql;create tablenew8 asselect distinct*from new;quit; /*这个例子看不出效果 是以行为标准*//*****************************************************//*SQL提升*//*一.将原始变量和二次分析生成的变量进行合并*/proc sql;create tablenew9 asselect name,sex,count(*) asmany label统计fromnewgroup by ageorder by name ;quit;proc sql;create tablenew10 asselect name,sex,count(distinctsex) as many label统计fromnewgroup by ageorder by name ;quit; /** Really 看不懂这的结果为什么输出来那样怎么做到的统计哦哦 看明白了 是利用年龄的统计 后面distinct age 剔除重复的年龄再统计*//*二.SQL语言的嵌套*/proc sql;create tablenew11 asselect *from(selectage, /*标点*/count(*)asmanyfrom newgroup by age)having manymax(many);/*重点*/quit;/*下面是不嵌套的*/proc sql;create tablenew12 asselect age,count(*)asmanyfrom newgroup by age;proc sql;create tablenew13 asselect *from new12having manymax(many);quit;/*三、连接 难难难~~~~*//*简单合并用merge在data步*//*交叉合并cross join 、 full join(key)、naturefull join(key)inner join、leftjoin、right join笔记本上*/data one;do a1,2;output;end;run;data two;do b10,9,8;output;end;run;data combined;merge one two;run;proc sql;create tablecombined asselect *from one cross join two;quit; /*两种合并处理效果不一样*//*四、where exists、where in(where any)查询数据库中已有的观测*/data H;input name $age;cards;John 12;proc sql;create tableHH asselect *from Hwhere exists(select*from newwhere h.namenew.name);quit; /*有趣哈哈哈哈*/proc sql;create tableHHH asselect *from hwhere name in(select namefrom new);quit;proc sql;create tableHHHH asselect *from hwhere nameany /*补充ANY用法 any(20,30)相当于20 (select namefrom new);quit;/*五、intersect(交集)union(并集)expect(补集)余集(得另外编程没有特定的代码)、union all(全集)、的区别*//*补充ALL用法 all(20,30)相当于大于30/*any就是大于小的小于大的all就是小于小的大于大的*//*小结对小型表连接 数据步更有效其余肯定SQL更有效啦*//*六、去掉标题(title)显示程序效率 (stimer)*/TITLE;proc sql feedback stimer;select *from neworder byage;reset nostimer outobs3;select *from neworder byage;quit; /*厉害这样显示*//*SQL在几个主要程序测试与效率exec/noexec控制SQL语句是否在执行nostimer/stimer在sas日志中报告每个SQL语句的效率统计数据noerrorstop/errorstop批处理时控制当有错误发生时是否要检查语法*//*七、利用宏变量*/data w;input ID $ a1-a4;cards;A 11 12 13 14B 21 22 23 24;/*计算各个变量之和*/proc sql;create tablesums asselect sum(a1) as sum1,sum(a2) as sum2,sum(a3) as sum3,sum(a4) as sum4 /*记住这没有点号*/from W;quit;/*等价*/proc summary dataw;var a1-a4;output outsumss(drop_type__freq_)sumsum1-sum4;run;data sumsss;set w endlast;ARRAY _a{*}a1-a4; /*定义数组*/ARRAY _sum{*}sum1-sum4;keep sum1-sum4;do i1 to 4;_sum{i]_a{i};end;if last then output;run;/*变量更多时 就用宏*/%macro selectsums(maxindex);%do n1 %to maxindex;sum(an)as sumn%if n NE maxindex %then ,;%END;%mend selectsums;PROC SQL;create tablesumssss asselect %selectsums(maxindex4)from w;quit; /*完美*//*八、利用SQL生成报表*//*九、混合复杂操作*//*行列转置 常规的转置有proc transpose ..*/proc sql;create tableww asselect id,a1 as item,a1 as vlauefrom wunion allselect id,a2 as item,a2from wunion allselect id,a3 as item,a3from wunion allselect id,a4 as item,a4from w;quit;proc sql;create tableverticalsums asselect *from ww;group byitem;quit;by tt.
http://www.zqtcl.cn/news/321176/

相关文章:

  • 腾讯建设网站视频宁波城乡住房建设厅网站
  • 乐清网站开发公司个人网站建设工作室
  • 网站空间升级通知手机端怎么看世界杯
  • 广西南宁网站推广建设网站视频教程
  • 福州专业网站建设推广费用nas可做网站服务器吗
  • 齐鲁建设网站福建省高速公路建设管理网站
  • 比格设计网站官网收录网站查询
  • 国外做直播网站淘宝电商网站怎么做的
  • 国外私人网站网站由那些组成
  • 网站备案多久通过机械设备网站
  • 企业自建站案例网站基础知识域名5个点
  • 咸宁建设网站海口市网站建设
  • 认识电子商务网站建设技术网站交换链接怎么做?
  • 定制商城网站建设全球搜索引擎排名2021
  • 徐州百度网站快速优化做网站视频图片加载不出来
  • 网站被host重定向处理浙江网新股吧
  • asp国外网站什么页游好玩
  • 高端简约30平米办公室装修广州搜索seo网站优化
  • 海口的网站建设公司wordpress二次元极简主题
  • 南京快速建站公司国家网站域名
  • 兰州装修公司哪家好网站seo推广员招聘
  • 郑州网站推广 汉狮网络易企秀类似的软件
  • 做外单网站成都网页制作公司排名
  • 成都优化网站关键词搜索引擎有哪些平台
  • 福建百川建设有限公司网站郑州手机软件开发公司
  • 盐城企业做网站多少钱88建网站
  • 南京网站制作报价wordpress主题 yusi
  • 北京建网站已备案网站新增接入
  • 做搬家服务网站问卷调查的目的房产网签是什么意思
  • 江苏品牌网站设计美团后台管理系统登录