I tried to understand how UNION works in SQL Server by executing the following script:
select *
from Production.ProductModel
where ProductModelID IN (3,4, 5, 6)
UNION
select *
from Production.ProductModel
where ProductModelID NOT IN (3,4, 5, 6)
Got following error:
The data type xml cannot be used as an operand to the UNION, INTERSECT or EXCEPT operators because it is not comparable.
It seems few other people got similar and posted in stack overflow; but, unfortunately I didn't understand the explanation by some champs. Can any please help me to understand.