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


Please Help Members By Posting Answers For Below Questions

Is sql between inclusive?

590


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

576


How does one use sql*loader to load images, sound clips and documents? : aql loader

669


is mysql query is case sensitive? : Sql dba

562


What is percent sign in sql?

717






what is the difference between clustered and non clustered index in sql? : Sql dba

549


What is the difference between the conventional and direct path loader? : aql loader

651


What is Difference Between Unique and Primary Key Constraints?

606


what is heap table? : Sql dba

608


What is pl sql quora?

648


What is plpgsql language?

530


What are the two types of periodical indexes?

505


i have a column which may contain this kind of value: 123*67_80,12*8889_5,34*8_874 ,12*7_7 (can contain space before a comma, and this string length can be anything) now i want to split this value into two column like: column1: 123*67,12*8889,34*8,12*7 column2: 80,5,874,7 use function for this

1064


What is the difference between count 1 and count (*) in a sql query?

498


What are different types of functions in sql?

511