This topic is locked

Advanced search requirement

5/20/2007 12:59:59 PM
PHPRunner General questions
O
osluk author

Is there a way to define a search so the when sorting by a field records in which this field is null are excluded?
For example this is sorting by the year 2000 price
http://www.bordeauxreport.com/db-2006-view...+en+primeur+GBP
Also

Currently 36 2000 prices are zero. (This has been altered I have left only 3 zero values for testing purposes).

Currently 161 2000 prices are null.
Clearly these all need to be unified but I cannot see how to filter by a null field.
Any insights gratefully received.
Cheers Chris

Alexey admin 5/21/2007

Chris,
use COALESCE MySQL function to convert NULL values to 0

I.e. modify your SQL query this way:

select

...

COALESCE(price,0) as price,

...