Monday, September 1, 2014

SQL Server filled out empty rows

You need to learn what a NULL value is.


You can adjust your original cold to handle null with a nullif function:



select a.ItemNum, isnull(nullif(a.remarks,''), b.remarks) as Batch, a.remarks, b.remarks
from #sample1 a
Left outer join #sample2 b
On b.ItemNum = a.ItemNum


No comments:

Post a Comment