摘要: 1 --简单case表达式 2 --case when 表达式用法1 3 --case 表达式 4 -- when exp1 then rslt ... 5 select a.product_id, 6 a.product_type_id, 7 case a.product_type_id 8 when 1 then 'Book' 9 when 2 then 'Video'10 when 3 then 'DVD'11 when 4 then 'CD'12 else 'M... 阅读全文
posted @ 2012-11-03 22:43 原想 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 1 --translate(x, from_string, to_string) 2 --函数在x中查找from_string中的字符,并替换成to_string中对应的字符 3 --下面是使用translate函数的实例: 4 5 --编码 6 select translate('SECRET MESSAGE: MEET ME IN THE PARK', 7 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ', 8 'EFGHIJKLMNOPQRSTUVWXYZA... 阅读全文
posted @ 2012-11-03 22:14 原想 阅读(558) 评论(0) 推荐(0) 编辑
摘要: 下面是Oracle中集合操作符实例(1)Union all1 --Union all 操作符2 select a.product_id, a.product_type_id, a.name3 from products a4 union all5 select b.prd_id, b.prd_type_id, b.name 6 from more_products b 7 order by 1(2)Uinon 操作符1 --Union 操作符2 select a.product_id, a.product_type_id, a.name3 from products a4 un... 阅读全文
posted @ 2012-11-03 21:05 原想 阅读(1588) 评论(0) 推荐(0) 编辑