hi,
if i use table1 only, how do i generate
the records having stk_date between '20081102' and '20081114' ?
(i only have 3 records -- ie. 20081101, 20081115, 20081121 -- in table1 as described)
my query string seemed to be (what i tried was more complicated, so i simplified it):
select table1.stk_no, table2.cal_date , table1.stk_qty
from table2, table1
where table2.cal_date =table1.stk_dat e(+)...
User Profile
Collapse
-
sorry, some were mis-typed ( part of "want to get")
stk_no stk_date stk_qty
------ -------- -------
abcd 20081101 10
abcd 20081102 10 <-- stk_qty of 20081101
abcd 20081103 10 <-- stk_qty of 20081101
...
abcd 20081114 10 <-- stk_qty of 20081101
abcd 20081115 20
abcd 20081116 20 ...Leave a comment:
-
for example
Code:SELECT * FROM ( SELECT DEPTNO, ENAME, SAL, ROW_NUMBER() OVER(PARTITION BY DEPTNO ORDER BY SAL DESC) TOPN FROM SALES ) WHERE TOPN<=1
Leave a comment:
-
i think your SQL statement is :
SELECT STARTDATE, ENDDATE
FROM PRONDUTYCOMPOFF
WHERE STATUS NOT IN('NULLIFIED')
AND (
:dt_bgn BETWEEN STARTDATE AND ENDDATE
OR
:dt_end BETWEEN STARTDATE AND ENDDATE
)
note --> :dt_bgn is the 'START' part of your input
:dt_end is the 'END' part of your input
...Leave a comment:
-
how to join 2 tables
hi, all
if i have 2 tables :
table1 (stocks)
Code:stk_no stk_date stk_qty ------ -------- ------- abcd 20081101 10 abcd 20081115 20 abcd 20081121 15
Code:cal_date workingday -------- ---------- ... 20081101 Y 20081102 Y 20081103 N 20081104 N ... 20081130 Y
No activity results to display
Show More
Leave a comment: