开发者

field appears null or empty sting but I can not select it

select *
from ss.mailer_data
where
id = 249122
and address_3 like'%%'

will not hit on address_3. I've tried changing the last line to

and address_3 is null

and address_3 = ''

开发者_C百科and address_3 = ' '

I tried using char_length, ascii functions and they return nothing for that filed value. Anyone have any ideas?


could also be that id = 249122 is not true for that combination. What happens when you do

select *
from ss.mailer_data
where address_3 is null

or

select *
from ss.mailer_data
where address_3 = ''


NULL is a special case - It's undefined but if that were your problem, Is Null should've found it

Can I ask you what data IS actually stored in Address3?

If you just want all records where address3 is empty/null,

select *
from ss.mailer_data
where
RTRIM(COALESCE(address_3, '')) =''

NB: LIKE is computationally expensive so use it carefully. Also, like '%%' is identical to Like '%'

Are you sure you had the right Id?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜