• Based on the limited information you've provided I have no idea what you really need for output as the new query you've provided with the UNION doesn't makes sense to me from a business perspective.

    You are getting an error because '' (empty string) does not convert to numeric so wherever you have '' and it is matching to a numeric in the other part you need to use 0 or NULL. So '' as Paid need to be either 0 as Paid or NULL as Paid.