|
-
Since last thread is too long, I begin a new one:
create table m (m_id int primary key, des varchar2(32));
create table d (d_id int primary key, posted date, m_id int);
alter table d add constraints d_fk foreign key (m_id) references m(m_id);
insert into m values (1, 'TEST1');
commit;
select m.DES, count(d.d_id)
from m, d
where m.m_id = d.m_id(+)
and m.m_id = 1
group by m.DES
/
DES COUNT(D.ID)
-------------------------------- -----------
TEST1 0
select m.DES, count(d.d_id)
from m, d
where m.m_id = d.m_id(+)
and m.m_id = 1
and d.posted >= to_date('27-OCT-2000','dd-mon-yyyy')
and d.posted <= to_date('22-NOV-2000','dd-mon-yyyy')
group by m.DES
/
no rows selected
Question is: Why not the second query return:
DES COUNT(D.ID)
-------------------------------- -----------
TEST1 0
Note: I tested this is not date comparsion issue,
nor to_char, nor to_date issue.
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
|