Subject | Re: [IBDI] Interbase 6.0 bug ? |
---|---|
Author | Ivan Prenosil |
Post date | 2000-10-09T14:46:04Z |
> A Query3=Yes, it is a bug. It is on both IB5 and IB6.
> Select * from ToDoList
> where ToDoList.code not in (select codefrom from ToDoListDone);
> => return me 0 record !!!!!
>
> Can somebody explain me why not Query1=Query2+Query3 ?
>
> I have found a solution:
> Select * from ToDoList
> where ToDoList.code not in (select codefrom from ToDoListDone where codefrom
> is not null);
> => retourn me 13 records, and Query1=Query2+Query3 !!!!
>
> Is it a bug ?
Two other solutions:
- If you create index on ToDoListDone(codefrom), you will get right result !
(or if you add foreign key constraint codefrom->code, IB will create index automatically)
- You can rewrite your command this way:
Select * from ToDoList
where not exists (select * from ToDoListDone where codefrom = ToDoList.code);
Ivan
prenosil@...