Subject Re: A Null problem
Author Svein Erling Tysvær
--- In firebird-support@yahoogroups.com, "Marvin" wrote:
> After viewing the suggested solutions, i've came up with this.
>
>
> 1: select table1.documentno,
> 2: table2.refno,
> 3: table2.chequestatus
> 4: from table1,table2
> 5: where table2.tid = table1.tid
> 6: and table1.documentno = ?
> 7: and ( table2.refno = ?
> 8: OR table2.refno is null)
>
> This seems to work fine and gives the best performance from my
> observation since i have table2.refno indexed.
> Thanks again guys!!
>
> Regards,
> Marvin

Well, Marvin, this may be a solution, but then the problem is
different from what you originally told us. Your query above will
always return all rows with unknown refno (provided tid and documentno
matched). Though it is a fair solution if you really want to get all
rows where refno is NULL regardless of the value of your parameter.

Set