随笔分类 -  SQL

1

group by 多行变成一行-- (sum (case end case 也可以完成同样功能))
摘要:[代码][代码] 阅读全文

posted @ 2009-09-10 15:22 dolphin_bobo

探讨SQL Server中Case 的不同用法
摘要:[代码] 阅读全文

posted @ 2009-07-19 02:20 dolphin_bobo

牛人,偶像 biti_rainy
摘要:http://www.itpub.net/268049.html牛人,偶像 biti_rainy 冯春培(biti_rainy)[代码]biti_rainy 曾任itpub Oracle开发版版主,现任itpub Oracle管理版版主和超级版主。 有丰富的oracle实践经验,对数据库的体系结构、备份恢复、sql优化、数据库整体性能优化、oracle internal都有深入研究。开发出身,对数... 阅读全文

posted @ 2009-06-30 17:04 dolphin_bobo

常犯的错误
摘要:[代码][代码] 阅读全文

posted @ 2009-06-26 03:49 dolphin_bobo

distinct /count/ other aggrevate function for null value
摘要:[代码] 阅读全文

posted @ 2009-06-20 03:52 dolphin_bobo

group by只能嵌套2层,而且一带有2层嵌套的字段,其他的普通字段都无法显示
摘要:[代码] 阅读全文

posted @ 2009-05-20 00:58 dolphin_bobo

current allocated/future/released '&' IN PL-SQL
摘要:[代码] 阅读全文

posted @ 2009-05-19 23:51 dolphin_bobo

SQL中exists和in的区别(转)
摘要:SQL中exists和in的区别(转) 假设如下应用: 两张表——用户表TDefUser(userid,address,phone)和消费表TAccConsume(userid,time,amount),需要查消费超过5000的用户记录。 用exists: select * from TDefUser where exists (select 1 from TAccConsume where TD... 阅读全文

posted @ 2009-05-17 23:58 dolphin_bobo

判断时间段是否有效区间
摘要:[代码] 阅读全文

posted @ 2009-05-11 17:53 dolphin_bobo

白痴错误!!!
摘要:[代码] 阅读全文

posted @ 2009-05-11 17:42 dolphin_bobo

Excel 数据导入 ORACLE
摘要:1 SQL Load - .CVF file2 Excel: Concatenate to build insert statement3 PL/SQL tools* Import data to 1 temp table 阅读全文

posted @ 2009-05-06 21:17 dolphin_bobo

外连接
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->-- out join sequenct : sub Collection1 => 结果集第一,二列有NULL值 2.考虑 Collection1(+) =dept =>Collectio... 阅读全文

posted @ 2009-05-02 20:15 dolphin_bobo

SQL 胡言乱语
摘要:任何函数,字段考虑NULL的作用 ORDER BY -- NULL TO_DATE,TO_CHAR 考虑格式 DECODE ,CASE --NULL GROUP BY NULL AS "COLUMN_NAME" 都要用AS 阅读全文

posted @ 2009-05-02 19:02 dolphin_bobo

利用SQL 构造EMP,DEPT表
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> SELECT ' SELECT ' ||'''' || EMPNO || ''' AS EMPNO ,' ||'''' || ENAME || ''' AS ENAME ,' ||... 阅读全文

posted @ 2009-05-02 18:58 dolphin_bobo

PNL 行列转置--decode /case when then else end
该文被密码保护。

posted @ 2009-04-29 21:00 dolphin_bobo

SQL 技巧-ORACLE
摘要:1)在select语句中使用条件逻辑 1select ename,sal, 2 case when sal = 4000 then 'OVERPAID' 4 else 'OK' 5 end as status 6from emp ENAME SAL STATUS ---------- ---------- -------... 阅读全文

posted @ 2009-04-28 19:05 dolphin_bobo

Start with - Connect by - level
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->--根目录开始遍历 --向下遍历 select prior a "prior_a" , prior b "prior_b" , prior c "prior_c" ,level ... 阅读全文

posted @ 2009-04-28 15:46 dolphin_bobo

Oracle 函数对null,空值的处理
摘要:Token CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* NVL2( string1, value_if_NOT_null, value_if_null ) RETURN Y*/ select nvl2('','N... 阅读全文

posted @ 2009-04-15 19:54 dolphin_bobo

聚合函数+Group by +having (2者都是对分组以后结果进行操作的)
摘要:CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> -- If using aggraviation function without group by --- it is the biggest group by ... 阅读全文

posted @ 2009-04-15 19:39 dolphin_bobo

Maxim date for Actualized outage
该文被密码保护。

posted @ 2009-04-15 19:19 dolphin_bobo

1

导航