SQL UNION result not the same as the result of individual statements? -


is possible union of 2 sql statements produce output different output of executing each of 2 statements separately?

yes. absolutely.

the union removes duplicates. if want same results, use union all.

also note: ordering after union , union all not guaranteed. if want things in particular order, use order by.


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -