UNION and UNION ALL giving multiple result sets even if INTERSECT does not lines.

Hello

I have a set of two queries. I used the UNION to join the result set. When I used UNION ALL, I get a different result set.

BT when I use INTERSECT, I m not getting all the lines.

SO, which I guess is, as operation INTERSECT isn't Govind all the lines, then the UNION and UNION ALL of the result sets must be simliar.

But I m getting different result sets.

Please guide me.

Thank you.

Hello

UNION returns separate lines; UNION ALL returns all rows that produce queries.

INTERSECT has nothing to do with it.  You can have the lines in a single query.  For example

Job SELECTION

FROM scott.emp

UNION - ALL THE

SELECT 'FUBAR '.

DOUBLE;

In this example, there is no overlap between the 2 queries (INTERSECT would have 0 rows).

UNION produces 6 lines, because the query at the top of the page produces 5 distinct lines (of 14 total ranks) and the background query 1.

UNION ALL product lines 15: 14 of the request from top and 1 of the request from the lower part.

I hope that answers your question.

If not, post a test script (if necessary) and complete, including some UNION, UNION ALL queries INTERSECT.  Post of the CREATE TABLE and INSERT statements for all tables using those queries (with the exception of the commonly available rtables, such as those of the scott schema) and a specific question, such as "the UNION query all product...» I expect the UNION query to produce... because... but instead, it produces... Why is this?  It seems contractict... manual which says that... ».

Tags: Database

Similar Questions

Maybe you are looking for

  • With the help of NOR-5641R with FPGA and the instrument driver

  • Simulate the module

    Hello! I'm building a testbed for manual control of the synchronous generator, and I'll use two modules NI - NI 9476 and NI 9209. So I need to wait for a while, the modules are purchased and delivered, so my question is - I can simulate these modules

  • Kodak esp 2150 All in one printer

    My above mentioned printer does not work properly.  Sometimes it will print and other times I have will obtain Error Codes and do not print.  The error codes are #501-100003 and 501-100007.  I can't seem to solve this problem, because the printer is

  • PCI Ethernet card does no not after PCI slot

    I have a card to PCI Ethernet D-Link DFE-520TX in one of the PCI slots and connected to a Linksys router. I wanted to install a new sound card so I changed the Ethernet card to an adjacent PCI slot. (without uninstalling the Ethernet card) After you

  • WRT54G2 brick 1.5

    So I tried to update firmare for FW_WRT54G2V1.5_1.5.02.005_US_20120221 and router has lost its connection. No, I can't join not via wifi or ethernet 192.168.1.1 I just power led flashes. Tried to reset for 30 sec, no luck