What is UNION,UNION ALL?
Answers were Sorted based on User's Feedback
Answer / sanjudharan
UNION : eliminates duplicates
UNION ALL: retains duplicates
Both these are used to combine the results of different
SELECT statements.
Suppose I have five SQL SELECT statements connected by
UNION/UNION ALL, how many times should I specify UNION to
eliminate the duplicate rows? -
Once.
| Is This Answer Correct ? | 22 Yes | 9 No |
How to handle null values in db2
Can we use group-by clause in sub-query? If 'yes' means,Will it be executed successfully or else If 'no' means why should we not using that method? Give me your suggestion please....
What is the use of COMMAREA ?Minimum how much data we can pass from it?
List some fields from sqlca?
How do you prepare a COBOL + DB2 program from coading till execution ?
What are the four lockable units for DB2?
How are write I/Os from the buffer pool executed?
What is a DB2 bind?
how to get duplicate records from tables?write qurey for this?
How do I optimize a query in db2?
how to unload different table data into different gdg files/ vsam files.
Can you use max on a char column?