Union - złącza zbiory w jeden wynik z ew. dublem.
Union All - złącza zbiory w jeden wynik i ew. eliminuje duble (tu jest sortowanie).
--*** KOD SQL ***
select FirstName, LastName from Person.Person as p1 where PersonType = 'EM' and FirstName like 'And%'
UNION
select FirstName, LastName from Person.Person as p1 where PersonType = 'EM' and FirstName like 'And%'
select FirstName, LastName from Person.Person as p1 where PersonType = 'EM' and FirstName like 'And%'
UNION ALL
select FirstName, LastName from Person.Person as p1 where PersonType = 'EM' and FirstName like 'And%'
Union vs Union All |