Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why doesn UNION of queries that return X and Y records return X+Y records?

queries records Return Union y
0
Posted

Why doesn UNION of queries that return X and Y records return X+Y records?

0

This is because UNION only returns unique records, i.e. if the same row is found in both result sets, it will be shown only once in UNION. It you wish to have all the rows use UNION ALL instead.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123