| Rush |
Posted: Apr 24, 2007 11:56:50 PM |
Total Post: 127
Joined: Jan, 2007
|
hi jayanta and all friends
i have little broblem in following query
*i want sum(sal) between given date,how can i do taht??
i m writing like this
select sum(sal) from emp
where hiredate between trunc(to_date('20-FEB-81'))and trunc(to_date('09-JUN-81'))
group by sal;
result is no rows selected.
welcome for your view
regards
RUPESH(RUSH)
|
|
|
jolly |
| Posted: Apr 25, 2007 02:12:12 AM | |
|
Total Post: 8
Joined: Apr, 2007
|
u can do it in the following way
select sum(sal)
from emp
where hiredate between trunc(to_date('20-FEB-81'))and trunc(to_date('09-JUN-81'));
SUM(SAL)
---------
11125
|
|
|
|
|
Ashu |
| Posted: Apr 25, 2007 11:02:26 AM | |
|
Total Post: 13
Joined: Jan, 2007
|
Hi,
You can also get the result from -
SELECT SUM(sal) FROM emp WHERE hiredate BETWEEN TO_DATE('20-feb-81') AND TO_DATE('9-jun-81');
There is no need for TRUNC function to be used.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |