What is the main difference between a UNION statement and a
UNION ALL statement?
1. A UNION statement eliminates duplicate rows; a UNION
ALL statement includes duplicate rows.
2. A UNION statement can be used to combine any number of
queries; a UNION ALL statement can be used to combine a
maximum of two queries.
3. A UNION statement can only combine queries that have
parallel fields in the SELECT list; a UNION ALL statement
can combine queries with differing SELECT list structures.
4. A UNION statement cannot be used with aggregate
functions; a UNION ALL statement can be used with aggregate
functions.
5. There is no difference between the two statements; they
are interchangeable.
Answer Posted / anil_abbireddy
1. A UNION statement eliminates duplicate rows; a UNION ALL
statement includes duplicate rows.
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
Can a varchar be a primary key?
What is the use of sqldataadapter?
How do I find duplicates in two columns?
What is a full join?
what is view? : Sql dba
Can we use update in sql function?
How many types of triggers exist in pl/sql?
GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?
What is an index in sql with example?
How do I kill a query in postgresql?
Explain the significance of the & and && operators in pl sql.
Which one is faster ienumerable or iqueryable?
What is sql performance tuning?
What is left join example?
Is stored procedure faster than query?