Re: NULL values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4 December 2010 11:40, Amit Tandon <attand@xxxxxxxxx> wrote:
> Dear Ron
>
> Or try this
>
> SELECT * FROM `paypal_payment_info` WHERE ifnull(os1, '') <>
> 'commission_paid'
> ============
> regds
> amit
>
> "The difference between fiction and reality? Fiction has to make sense."
>
>
> On Sat, Dec 4, 2010 at 7:55 AM, Ron Piggott
> <ron.piggott@xxxxxxxxxxxxxxxxxx>wrote:
>
>>
>> When I do the following query in mySQL only 1 record is retrieved.
>>
>> SELECT * FROM `paypal_payment_info` WHERE `os1` NOT LIKE 'commission_paid'
>>
>> I am surprised by this. ÂThis one record has no characters in it, but the
>> âINSERT INTOâ that created it used: ( `os1` ) VALUES ( ââ ) instead of: (
>> `os1` ) VALUES ( NULL ) . ÂThere are a number of records where `os1` is
>> NULL. ÂI would like these rows to retrieve as well. ÂHow do I make a WHERE
>> clause for a cell that is NULL ?
>>
>> Ron
>>
>> The Verse of the Day
>> âEncouragement from Godâs Wordâ
>> http://www.TheVerseOfTheDay.info
>>
>

http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_isnull

where isnull(column, '') <> 'value'



-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux