Hi I have a table like below
create table #test1(CatTitle_E varchar(10),CatTitle_F varchar(10),CatTitle_G varchar(10), CatTitle_J varchar(10)) insert into #test1 select 'manoj','diwari','ind','x1' union select 'ponting',null,null,null union select null,null,null,null union select 'balaji','','','' union select '','','','' union select '','watson','shane','aus' select * from #test1
I want the output to handle NULL or Empty string and replace with value like below
**Condition 1:**
It replaces if the Cattitle F,G,J have any value we have to put that value
**Condition 2:**
but if Cattitle F,G,J have null or empty we have to put Cattitle_E value
Sample Output looks like For If We consider CatTitle_E and CatTitle_F only:(I need same as remaining)see pic below:
![alt text][1]
I searched in Any function related to handle in empty value in SQL it is not available.
Only we have **Coalesce(),Nullif(),Isnull()** functions are only available.
**So Is any one to help me to achieve this using function or UDF function in SQL?????**
[1]: /storage/temp/663-op.jpg