What is UNION,UNION ALL?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is db2 purescale?

547


Are view updateable?

627


What is a buffer in memory?

600


Explain the benefits you can get from mainframe connect?

520


How do I delete a column in db2?

678






What is null indicator in cobol db2?

583


What is db2 bind process?

754


What is schema in db2?

574


What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?

708


What is dbrm library?

578


How can we retrieve the total number of records in RPG & CLLE?

194


While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?

1818


Can one database have multiple instances?

582


What is meant by dclgen?

618


What is runstats db2?

580