4
Answers

Sql query for multiple values in single field.

Ask a question
Milton Smith

Milton Smith

16y
10.4k
1

I have a table called vendors which have two field ven_txt_CompanyName and ven_txt_VendorName.
I have always some value for ven_txt_VendorName but ven_txt_CompanyName sometimes has value as NULL ,
or it have no value or sometimes it has value.Something like this.

ven_txt_CompanyName      ven_txt_VendorName

Gift Emporium                     Mcpartland, Sandy
NULL                                Nicholson, Don
Jacks Wholesale                 Varela, Jimmy
                                          Goggins, Jerry
NULL                                Swinson, Billy
                                           Dee, Teresa
NULL                                 Olsen, Ysa


So what I have to do is if ven_txt_VendorName is null or it contains blank value replace it with corresponding
ven_txt_CompanyName value else ven_txt_CompanyName value will remain as it is.


Answers (4)