SQL NULLIF
NULLIF kullanımı . . .
CREATE TABLE #tmpTable ( Id int, CustomerName varchar(50), identification_number varchar(11), tax_number varchar(10) ) GO INSERT #tmpTable VALUES(1,'Firma A', '12345678912', '9876543213'); INSERT #tmpTable VALUES(2,'Firma B', '', '4568529873'); INSERT #tmpTable VALUES(3,'Firma C', NUll, '9876543213'); select Id, CustomerName, isnull(identification_number, tax_number) as tax_number from #tmpTable select Id, CustomerName, isnull(nullif(identification_number,''), tax_number) as tax_number, 'nullif KULLANILDIĞINDA' as info from #tmpTable --Farklı kullanımları var --tax_number = '4568529873' ise NULL yapmak içinde kullanılabilir. select Id, CustomerName, nullif(tax_number,'4568529873') as tax_number, 'nullif KULLANILDIĞINDA' as info from #tmpTable