>UNION will filter the duplicate records, BUT you will never have ones, because of CAST('' AS char(50))
>
>
>SELECT 1, 'abracadabra'
>UNION
>SELECT 1, ''
>
>will generate two records
I see now, you're right. We do need a left join in the second portion with is null in where clause.
If it's not broken, fix it until it is.
My Blog