|
-
I have master table location and detail table
application.
select l.location_number, count(a.application_id)
from application a, location l
where
l.location_id = 102884
and l.location_id = a.location_id(+)
group by l.location_number
/
LOCATION_NUMBER COUNT(A.APPLICATION_ID)
------------------------------ -----------------------
2323 0
While if I add a condition in where clause:
and a.posted >= to_date('27-OCT-2000 00:00:00', 'DD-MON-YYYY HH24:MI:SS')
and a.posted <= to_date('22-NOV-2000 00:00:00', 'DD-MON-YYYY HH24:MI:SS')
The query will be:
select l.location_number, count(a.application_id)
from application a, location l
where
l.location_id = 102884
and l.location_id = a.location_id(+)
and a.posted >= to_date('27-OCT-2000 00:00:00', 'DD-MON-YYYY HH24:MI:SS')
and a.posted <= to_date('22-NOV-2000 00:00:00', 'DD-MON-YYYY HH24:MI:SS')
group by l.location_number
/
I got:
no rows selected
How can this happen? I want to see:
LOCATION_NUMBER COUNT(A.APPLICATION_ID)
------------------------------ -----------------------
2323 0
Note: This is just partial query which I abstract
to ask help.
Also, posted field is date field.
Thanks,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|