• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






GoDevil

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

随笔分类 -  Oracle developer

 
Oracle取整的函数
摘要:1.取整(大)   select ceil(-1.001) value from dual   2.取整(小)   select floor(-1.001) value from dual  3.取整(截取)  select trunc(-1.002) value from dual 4.取整(舍入) select round(-1.001) value from dual 阅读全文
posted @ 2009-11-04 18:48 Kevin's Blogy 阅读(372) 评论(0) 推荐(0)
Traversing the Dept Security tree
摘要:We can use the connect by prior function provided by Oracle to traverse the Dept security Tree . Suppose an Organization has 7 levels in Dept tree i.e. 1 to 7 .We want to traverse the dept tree from l... 阅读全文
posted @ 2009-07-27 14:49 Kevin's Blogy 阅读(325) 评论(0) 推荐(0)
Database Table Space Statistics
摘要:An SQL to help gathering storage tablespace statistics. The SQL will list all tablespace names in a particular database along with available, used and percent used storage space in MB.SELECT a.tables... 阅读全文
posted @ 2009-07-27 13:25 Kevin's Blogy 阅读(199) 评论(0) 推荐(0)
Oracle Group By Grouping Sets
摘要:So, what if you are only interested in totals. Well, Oracle does provide an extension to the GROUP BY clause called GROUPING SETS that you can use to generate summary information at the level you choo... 阅读全文
posted @ 2008-08-11 16:28 Kevin's Blogy 阅读(684) 评论(0) 推荐(0)
Oracle Group By ROLLUP-SubTotal
摘要:At normal time, you may want to have the subtotal for each region over all months, along with the total for all regions, or you may want the subtotal for each month over all regions, along with the to... 阅读全文
posted @ 2008-08-11 16:23 Kevin's Blogy 阅读(997) 评论(0) 推荐(0)
Decode()函数使用技巧
摘要:decode(条件,值1,翻译值1,值2,翻译值2,...值n,翻译值n,缺省值)该函数的含义如下:IF 条件=值1 THEN    RETURN(翻译值1)ELSIF 条件=值2 THEN    RETURN(翻译值2)    ......ELSIF 条件=值n THEN    RETURN(翻译值n)ELSE    RETURN(缺省值)END IF· 使用方法:1、比较大小sele... 阅读全文
posted @ 2008-08-11 13:50 Kevin's Blogy 阅读(390) 评论(0) 推荐(0)
START WITH and CONNECT BY in Oracle
摘要:start with .. connect by clause can be used to select data that has a hierarchical relationship. Usually, it is some sort of parent child relationship like supervisor and an employee. Let’s assume we ... 阅读全文
posted @ 2008-08-08 16:13 Kevin's Blogy 阅读(319) 评论(0) 推荐(0)
Compare Data from the Same Table in two Different Environments
摘要:The Oracle SQL below compares table1 that has 2 key fields and 3 regular fields. Note: For the SQL below to work, your password needs to be the same in both environments. If not, then a connection usi... 阅读全文
posted @ 2008-08-08 15:30 Kevin's Blogy 阅读(307) 评论(0) 推荐(0)
Get Table Sizes in your Schema
摘要:If you want to see how much space your tables are taking in the database, log in to the shcema and execute this SQL. SELECT segment_name table_name, MAX (tablespace_name) tablespace_name, S... 阅读全文
posted @ 2008-08-07 12:34 Kevin's Blogy 阅读(239) 评论(0) 推荐(0)
Create a Database Link
摘要:In many cases you might need to compare data between tables across different databases. For example your test instance and production instance. You can easily create a database link between the 2 i... 阅读全文
posted @ 2008-08-07 12:33 Kevin's Blogy 阅读(349) 评论(0) 推荐(0)
Oracle Minus Operator
摘要:I find the MINUS operator very handy and use it a lot to compare tables and find out missing things. For example suppose you want to compare Table1 with Table2. If the two tables have the same layou... 阅读全文
posted @ 2008-08-07 12:30 Kevin's Blogy 阅读(281) 评论(0) 推荐(0)