上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 36 下一页
摘要: 0、distinct用法 在oracle中distinct的使用主要是在查询中去除重复出现的数据 直接在字段前加distinct关键字即可,如:select distinct 名字 from table distinct关键字也可以同时为多个字段进行去重, 如:select distinct 名字, 阅读全文
posted @ 2020-03-31 18:06 马踏飞燕Beautiful 阅读(9855) 评论(0) 推荐(1) 编辑
摘要: 0、exists() 用法: select * from T1 where exists(select 1 from T2 where T1.a=T2.a) 其中 “select 1 from T2 where T1.a=T2.a” 相当于一个关联表查询, 相当于“select 1 from T1, 阅读全文
posted @ 2020-03-31 17:57 马踏飞燕Beautiful 阅读(3836) 评论(0) 推荐(0) 编辑
摘要: 0、例如:select * from T1,T2 where T1.a=T2.a 1、连表查询 <=> join(inner join)内连接查询 数据源: Persion表: Orders表: //使用连表查询SELECT Persons.LastName, Persons.FirstName, 阅读全文
posted @ 2020-03-31 16:45 马踏飞燕Beautiful 阅读(2823) 评论(0) 推荐(0) 编辑
摘要: #查看表 select * from `竟企区域数据分析` #在表第一列新增名为“年月”的列alter table `竟企区域数据分析` add column 年月 varchar(20) not null first alter table LEAP.工作单回写表 add (填写人 varchar 阅读全文
posted @ 2020-03-31 13:28 马踏飞燕Beautiful 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 0、数值是常规的数值: [蓝色]"↑"0;[红色]"↓"0;[黄色]"→"0 [蓝色]"↑"0.0;[红色]"↓"0.0;[黄色]"→"0.0 1、数值是百分比的数值: [蓝色]"↑"0.00%;[红色]"↓"0.00%;[黄色]"→"0.00% #大于0.00%(百分比数值是保留小数点后2位的数值 阅读全文
posted @ 2020-03-31 09:53 马踏飞燕Beautiful 阅读(8770) 评论(0) 推荐(0) 编辑
摘要: , 阅读全文
posted @ 2020-03-16 13:43 马踏飞燕Beautiful 阅读(919) 评论(0) 推荐(0) 编辑
摘要: 背景: A表、B表两表关联,关联出来的结果里B表有不止一条,需求是只要B表结果中的某一条(按某字段排序) 经过百度,发现 row_number() over(partition by a order by b desc)函数可用(需要说明下,order by 必须有缺少会报错),以下是数据环境及结果 阅读全文
posted @ 2020-03-16 13:27 马踏飞燕Beautiful 阅读(8020) 评论(0) 推荐(1) 编辑
摘要: 0、round函数 按照指定小数位数进行四舍五入运算。 SELECT ROUND( number, [ decimal_places ] ) FROM DUAL #number : 待处理数值 decimal_places 四舍五入 , 小数取几位 ( 预设为 0 )。 例子 : select ro 阅读全文
posted @ 2020-03-11 17:30 马踏飞燕Beautiful 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 有两个日期数据START_DATE,END_DATE,欲得到这两个日期的时间差(以天,小时,分钟,秒,毫秒): 天:ROUND(TO_NUMBER(END_DATE - START_DATE))小时:ROUND(TO_NUMBER(END_DATE - START_DATE) * 24)分钟:ROU 阅读全文
posted @ 2020-03-11 16:32 马踏飞燕Beautiful 阅读(487) 评论(0) 推荐(0) 编辑
摘要: 0、函数concat(A,B)作用:链接字符串 区别: Oracle中:CONCAT()只允许两个参数;(貌似可以内嵌) Mysql中:CONCAT()可以连接多个参数; 1、用||符号进行拼接 例子:select A||B from test 结果就是AB合并 例子:select “A” || “ 阅读全文
posted @ 2020-03-11 14:36 马踏飞燕Beautiful 阅读(4197) 评论(0) 推荐(1) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 36 下一页