Subject | Re: A Null problem |
---|---|
Author | Marvin |
Post date | 2006-04-13T05:25:10Z |
> Well, Marvin, this may be a solution, but then the problem isWell Svein, I guess i've gotta work more on my accuracy. Initially, i
> 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
>
was trying to find a way to select records when variable2 is null as
my current implementation at that time was unable to do so. The
solution that you suggested,
7: and COALESCE(table2.refno, 'NonExistingValue') = ?
is most accurate functionally in comparison to my original query.
However, at the cost of performance(a search took on average 8 - 10
seconds). So, a little give-and-take is required.
The solution i chosed is ASSUMING that the documentno maps to only 1
refno which is either null or not null, as this is the expected
result. But i guess i gotta add some mechanism in case it returns more
than 1 result set.