摘要: 先写个例子 SELECT supdepartment,salordicode FROM salorder WHERE sheetcode='27.TY1.15.30.10' AND salordicode='CHZC0010000000000000360' 查询时,结果如下: SQL将一个字段多值, 阅读全文
posted @ 2021-04-15 17:08 饺子有个排骨梦 阅读(1312) 评论(0) 推荐(0)
摘要: 第一: select ROW_NUMBER() OVER (ORDER BY a.字段 ASC) AS XUHAO,a.* from table a(table 为表名,字段为表a中的字段名) 第二: select RANK() OVER (ORDER BY a. 字段 ASC) AS XUHAO, 阅读全文
posted @ 2021-04-15 16:58 饺子有个排骨梦 阅读(812) 评论(0) 推荐(0)
摘要: nvl(r.seccofcy,0) 金额为空时,数值会变0 select nvl(seccofcy,0) from salorderg 还有一种方法是用 : isnull(r.fcy,0) 【时间字段只取日期,不带时间的函数sql】trunc(sysdate) select trunc(sysdat 阅读全文
posted @ 2021-04-15 16:49 饺子有个排骨梦 阅读(326) 评论(0) 推荐(0)
摘要: select decode(b,0,0,a/b) from dual;decode(除数,0,显示0%,不为零的正常表达式)代替原来那个有可能出0除报错的表达式举例:select decode(b,0,0,a/b*100) per from tab; 阅读全文
posted @ 2021-04-15 16:46 饺子有个排骨梦 阅读(424) 评论(0) 推荐(0)
摘要: 第一天做个笔记,留个纪念哦~ 阅读全文
posted @ 2021-04-15 16:42 饺子有个排骨梦 阅读(32) 评论(0) 推荐(1)