例如:
select province+city+area+street as address from addressmst where address_id=28
其中province、city、street都有值,但是如果area的值为NULL的话,就会显示为NULL。
如果将为NULL的字段去掉,则显示address有值:
select province+city+street as address from addressmst where address_id=28
------解决方案--------------------
- SQL code
select province+city+isnull(area,'')+street as address from addressmst where address_id=28
------解决方案--------------------
isnull(col1,'')+isnull(col2,'')+isnull(col3,'')+isnull(col4,'') 即可