文章列表
cusor PROCEDURE 都可以设置默认参数,
使用关键字default,在调用的时候,对应的参数如果没有,则使用设置的default;
AND TO_CHAR(D0060,'Dy') IN (SELECT * FROM TABLE(sARRAY))
- 2009-07-09 20:24
- 浏览 858
- 评论(0)
SELECT UPPER(CASE '&flag'
WHEN '1' THEN
'leo'
WHEN '2' THEN
'len'
ELSE
'paul'
END
)
FROM DUAL;
SELECT DECODE('&flag', '1', 'leo', '2', 'len', 'pa ...
- 2009-06-19 13:55
- 浏览 1103
- 评论(0)
不知道在那本书上看到的,group by 就是为了取得符合where条件的位于group by 条件中的列中的值。
如果列中的值都相同,则返回一条相同的;
如果某列的值有不同的,则返回的结果集的行数等于此列不同值得行数。
似乎还是正确的。
特此小记。
- 2009-06-19 10:50
- 浏览 679
- 评论(0)
, sum(nvl(case when a.d0180 is not null and a.d0170 is not null then
case when to_number(a.d0180)
> to_number(a.d0170) then
(to_number(substr(a.d0180, 1, 2)) * 60 + to_number(substr(a.d018 ...
- 2009-06-18 16:06
- 浏览 685
- 评论(0)
if data(i).searchDate = v.d0040 then
case sCareLevel
when '6' then
data(i).sien1_teikyou_min := v.total;
data(i).sien1_teikyou_cnt := v.cnt;
data(t).sien1_teikyou_min := data(t).sien1_teikyou_min + data(i).sien1_teik ...
- 2009-06-18 15:49
- 浏览 990
- 评论(0)
For this reason, the caching algorithm I'm describing is often called an LRU caching algorithm.
缓存算法经常被称为LRU缓存算法。最不常用,最冷的数据会自动的从缓存中falls off;
The theory is that the hottest data will cycle to the head of the list and therefore live longer on the list. Really hot data might never leave the list at all ...
- 2009-06-09 00:13
- 浏览 594
- 评论(0)
There are three basic steps to SQL tuning:
1.Figure out which execution plan (path to reach the data your SQL statement demands) you are getting.
2.Change SQL or the database to get a chosen execution plan.
3.Figure out which execution plan is best.
In another word:
1.Which execution plan is be ...
- 2009-06-08 22:31
- 浏览 706
- 评论(0)
过程和函数中的参数的类型只需要声明类型,而不用指定长度(精度);
带参数的cursor的参数也只需要声明类型,而不用指定长度(精度);
只有单独声明的变量需要指定长度(精度);
如:
CURSOR C_SELECT2 (ResID VARCHAR2, ResNo VARCHAR2);
res_303 (sUid IN VARCHAR2,
sPw IN VARCHAR2,
s ...
- 2009-06-02 23:43
- 浏览 1376
- 评论(0)
近日复习多态,迟绑定,略有小得:
多态就是看
1.对象具体是哪个类(java单继承,只能是一个子类。C++多继承,具体是哪个类的子类) 的对象。
2.子类override了父类的那个方法。
3.父类引用调用了子类override的方法。
于是,会
迟绑定,调用子类对象的这个方法。
C++尚待落实,代码落实后,在改正。
- 2009-05-26 22:23
- 浏览 721
- 评论(0)
SELECT CASE
WHEN SUM(SUBSTR(D0050, 1, 1)) > 0 THEN
1
ELSE
0
END DAY1 --月曜日
,
CASE
WHEN SUM(SUBSTR(D0050, 2, 1)) > 0 THEN
1
...
- 2009-05-26 18:51
- 浏览 834
- 评论(0)
通过使用EXISTS,Oracle会首先检查主查询,然后运行子查询直到它找到第一个匹配项,这就节省了时间。Oracle在执行IN子查询时,首先执行子查询,并将获得的结果列表存放在一个加了索引的临时表中。在执行子查询之前,系统先将主查询挂起,待子查询执行完毕,存放在临时表中以后再执行主查询。这也就是使用EXISTS比使用IN通常查询速度快的原因。
- 2009-05-06 09:01
- 浏览 697
- 评论(0)
通过使用EXISTS,Oracle会首先检查主查询,然后运行子查询直到它找到第一个匹配项,这就节省了时间。Oracle在执行IN子查询时,首先执行子查询,并将获得的结果列表存放在一个加了索引的临时表中。在执行子查询之前,系统先将主查询挂起,待子查询执行完毕,存放在临时表中以后再执行主查询。这也就是使用EXISTS比使用IN通常查询速度快的原因。
- 2009-04-17 12:41
- 浏览 449
- 评论(0)
To write a query that performs an outer join of tables A and B and returns all rows from A (a left outer join), use the LEFT [OUTER] JOIN syntax in the FROM clause, or apply the outer join operator (+) to all columns of B in the join condition in the WHERE clause. For all rows in A that have no match ...
- 2009-04-01 12:25
- 浏览 685
- 评论(0)
group by 基础:
Specify the GROUP BY clause if you want Oracle to group the selected rows based on the value of expr(s) for each row and return a single row of summary information for each group。
也就是说,如果不使用分组函数,返回的是一组数据的统计内容,只一行,所以,参与分组的列都应该存在于group by 中。个人思考,还在修正中。
修正1:
修改红字中的内容如下:
GROUP BY clause,也就是说 ...
- 2009-03-31 16:45
- 浏览 725
- 评论(0)
case when 似乎是不能用在where后面的and中了,where(case when), 用在select中倒还可以。where中进行if逻辑,可以用decode函数,或者用and or 连接模拟if条件。
不正确的话,请指摘。
- 2009-03-31 16:25
- 浏览 980
- 评论(0)