Kind of strange need with UNION

Hello,
There are 2 tables located on 2 different dbs but the tables structure are the same.
I perform:
Select name, version, status, price, input date
from product@DB1
UNION
Select name, version, status, price, input date
from product@DB2
BUT if (name and version and status) are the same for 2 records coming from DB1 anb DB2, I want to have only the record coming from DB2.
Exemple:
If DB1 has a record with
"Engine 1.0 Available 10$ 21/01/2004"
and DB2 a record with
"Engine 1.0 Available 12$ 22/02/2005"
I want only the record "Engine 1.0 Available 12$ 22/02/2005" to be returned.
Having a group by is not enough as I can't choose the record displayed (?).
Any help is greatly appreciated.
Regards,
Guillaume.

Hello
if you use union all instead of union you will get rid of a sort and get a list of all records back from both queries. You can then use this as the result set to feed into another query which will let you select the rows you want. Something along these lines.
SELECT
    name,
    version,
    status,
    price,
    input_date
FROM
  SELECT
    name,
    version,
    input_date,
    price,
    db_id,
    row_number() OVER(PARTITION BY name,version,status ORDER BY db_id DESC) rn
  FROM
    (SELECT
          1 as db_id
          name,
          version,
          status,
          price,
          input_date
     from
          table@db1;
     UNION ALL
     SELECT
          2 as db_id
          name,
          version,
          status,
          price,
          input_date
     from
          table@db2;
) a
WHERE
    a.rn = 1;I've not been able to test it as of yet but the principal should work. If you only want prioritise the row based on which database it came from then use the db_id. It may be better though to use a not exists clause to prevent rows comming back from db1 where they already exist in db2. If you want to prioritise on something else, such as input date, you can change that:
row_number OVER(PARTITION BY name, version, status ORDER BY input_date)If you want to see where the row came from you can put the db_id in the outer query.
HTH
David

Similar Messages

  • A strange issue with importing avi video

    I have a rather strange issue with importing avi files (which playback normally in other programs) into CS4. When I import an avi recorded from my camera into CS 4 in the preview the sound is played back normally, but the video itself is weird. Pretty much roughly first 5% of it are stretched over the whole spand and slowed down to fit. So the video of 4 minutes will play sound normally for 4 minutes, but replay only 10 seconds of video VERY slowly. I'm a bit puzzled because I've used the same camera with CS3 and never encountered this problem. breaking apart and speeding up the video obviously didn't work because the video only displays the first 5 recorded seconds no matter the speed, tweaking with presets didn't work either.

    subtlemolotov wrote:
    I obviously know it's a photo camera, I own it.
    The point is it's something we needed to know to answer your question.
    subtlemolotov wrote:
    Well I've found a very unprofessional solution.
    "An unprofessional solution?" Kind of like shooting video with an still camera.....

  • Help needed with robocopy

    Hello all,
    Iam having a strange issue with robocopy and need some help to understand whats causing it.
    Iam using robocopy to copy some files to my backup server. Problem is that my backup server doesn't recognize them to create a "stub" file (kind of a pointer to the real file). But if i use xcopy %orig% %dest% /A /E /J  to copy the files all
    works good.
    Can anyone help me understanding whats the difference between them (in the background)? What options should i use on robocopy to make it similar to xcopy? Allready tried a few options and haven't made it work...
    Regards,
    Arestas

    Hi Arestas,
    >>Can anyone help me understanding whats the difference between them (in the background)? What options should i use on robocopy to make it similar to xcopy?
    How did we specify source and destination paths when we used Robocopy? For Robocopy, the source and destination parameters should be specified as drive:\path or
    \\server\share\path.
    For Robocopy and how to use it, the following articles can be referred to for more information.
    Get to Know Robocopy for More Powerful File Management
    https://technet.microsoft.com/en-us/magazine/ee851678.aspx
    Robocopy and a Few Examples
    http://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx
    Robocopy
    https://technet.microsoft.com/en-us/library/cc733145.aspx
    Best regards,
    Frank Shen
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • View Master mode strange behaviour with jpg files

    Hy all,
    I'm using Aperture, and I'm tweakin a lot the SW to discover all secrets ....
    I'm really concerned about a strange behaviour of the SW in view mode.
    If I open a jpg file, do not apply ANY modification, and apply the "show master" command (pressing M), there's a subtle behaviour :
    *the images get sharper !!!!*
    It behaves as if an "edge sharpening" was applied !!!!!!
    With _RAW files this thing doesn't happen at all._
    Even stranger, if I zoom to full definition (by pressing Z), and toggle between normal view and "show master" view, the immage remains the same !
    The effect is not so evident with all images, but sometimes it is !!
    Anyway, I expect not to have such kind of things with a professional SW.
    With professional cameras and good quality files it's really annoying not to beeing sure what's the REAL content of the jpg image.
    Has anyone noted this thing ? Is there a reasonable explanation ?
    The only one I tried to figure out is the following : may be Aperture applies some kind of resampling algorithm with jpg files (bicubic, bilinear, etc).
    May be this resampling is not applied with 100% magnification, as weel as with raw files.
    But it's only my guessing. Now, I'm tweaking other viewers and other SW to understand what's the real jpg image stored in the file : the blurer one form normal view or the sharper one with "show master" mode.
    I stress once again : of course, the jpg file I'm talking about have no settings at all, just imported and toggled with M button.
    Thanks in advance.
    Regards,
    Enzo

    Hy,
    I'm afraid I'm not been clear.
    The problem is this :
    1) jpg image opened in normal view mode, no zoom, (no quick preview, of course) : image with a certain amount of blour
    2) jpg image opened in show master mode, no zoom, (no quick previre, of course) : image SHARPER with respect with the previous.
    No edit applied from import, so "show master" command shouln't apply any change in rendering, should it ?
    The only thing I said on 100% view is that such difference (between normal mode e show mastermode) is not present with 100% magnification.
    That was the issue.
    Enzo

  • Help needed with dramatical bad performanc​e of gauge controls

    This VI causes the problems
    With kind regards
    Martin Kunze
    With kind regards
    Martin Kunze
    KDI Digital Instrumentation.com
    e-mail: [email protected]
    Tel: +49 (0)441 9490852
    Attachments:
    Page 1_3D_1.vi ‏235 KB

    Martin, listen to CC, the main problem really is overlapping objects (text and digital displays)! The LabVIEW application without overlapping object is 500x faster than yours (See attached, LabVIEW 7.1). I get loop times of below 1ms (>1KHz!) versus your original version with 400-500ms, so LabVIEW can beat your C application by 10x IF you avoid overlapping objects.
    (I am using an ancient 1GHz PIII laptop, so the loop times on a modern computer will be much faster)
    I agree with Aaron that your property nodes contribute to the problem. After deleting all unecessary property node terminals (they never change!), the only bad one is the constantly variable color scale of the oil pressure. Is this even meaningful to the user? This property write alone costs a few tens of ms(!) so it might be reasonale to either get rid of it completely or update it at a lower rate (In the attached example it happens every 100 iterations, modify as needed (LAbVIEW 7.1)).
    If you go back to 200ms loop times, my version will only use a few % of cpu.
    Note also that you can do your entire color ramp with 4 elements, six is overkill and just complicates things. I would also get rid of the blinking, it's just too ugly. Use a Red LED to indicate the special condition.
    Yes, the performance hit with overlapping objects is surprising, but I am sure there is a good reason and we win elsewhere. It has been my experience that most aspects of LabVIEW are highly optimized under typical conditions (IF properly used!).Message Edited by altenbach on 05-09-2005 01:53 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Page03faster.vi ‏194 KB

  • Select query with UNION clause in database adapter

    Friends,
    I have got a SQL query with two UNION clause withing it. like
    select a,b,c
    from a
    union
    select a,b,c
    from b
    The schema generated is like below in sequence
    <element>a</element>
    <element>b</element>
    <element>c</element>
    <element>a</element>
    <element>b</element>
    <element>c</element>
    So, the columns from different select queries joined with UNION clause are all appeared in schema instead of the distinct columns.
    Is there any way around to solve this issue ? or will need to with DB function/procedure.

    I think I know what you are saying but your example doesn't make sense, your SQL should produce something like
    I had to change a, b, c with elementA, elementB, elementC as a and b are reserved html tags.
    <elementA>DateA</elementA>
    <elementB>DataB</elementB>
    <elementC>DataC</elementC>
    ...What is the result of the query when you run it in SQLPlus? Is it what you expect?
    cheers
    James

  • Strange issue with external monitor, only working when external speakers plugged in (using Thunderbolt to VGA adaptor)

    Hey – I am having a very strange issue with my external monitor; where it only works if my external speakers are plugged in and connected.
    I am using a late 2011 Macbook pro, running Mavericks 10.9.4, along with an MBox 2 (USB Audio Interface), and two powered speakers (KRK Rokit 5). This setup has had no issues. I have just acquired an external monitor (Benq T2200HD), which I am using with a thunderbolt to VGA adaptor (a cheap Chinese knockoff adaptor).
    To start - I plugged the monitor in with the thunderbolt adaptor, and it powers up and works fine. However, there is a nasty buzz coming from the speakers. I did some research and it looks like a simple ground loop issue. I did a bit of troubleshooting, and this is where things get weird.
    What I found is - If I unplug the MBox, the monitor loses signal from the computer (displaying ‘No Signal Detected!’). Further, if I keep the MBox plugged in, however unplug both the cables from the MBox to the speakers, the monitor loses signal. It doesn’t matter if the speakers are turned off, however they need to be plugged in (or the monitor loses signal). Weirder still, I can unplug the MBox, however the monitor will work if I plug in the speakers through my macs headphone jack.
    Simply put, the monitor only works if there is a direct connection between the computer, the speakers, and the power source.  What is going on here? Is the monitor grounding through the computer port, to the speakers (I don’t know how this works, is this possible?). Could it somehow be the cheap VGA adaptor I am using?
    Some other information:
    - Everything is plugged into the same multi-box for power. I have tried plugging things into separate sources, and the result is the same.
    - If I unplug the thunderbolt adaptor, then the speaker noise disappears straight away.
    - The ground noise doesn’t appear in my headphones, which are plugged into the MBox.
    Any information would be great – am I missing something here, or is this genuinely weird?

    Well, I went back into Best Buy to test on 3 other laptops (2 Asus, and their floor model for this Sony). It seems to be doing the same problem so at least I was able to rule out broken hardware issue on my particular laptop.
    Here's what I did to test:
    Since I couldn't really install Adobe Premiere on their machines, I used the DVIO software (http://www.carr-engineering.com/dvio.htm) and a 5 min clip I captured.  I transferred onto their machines, hooked up my Sony D8, and attempted to play the video.  It would play for 15 seconds and then stop and jitter with a loud noise (like it does on my laptop).  I even tried changing each machine's firewire driver to the legacy one and same results.  I pulled a brand new 4 pin to 4 pin firewire cable off their shelf and still the same problem.
    I think I've nailed it down to Win7x64 bit Home Edition not playing nice with Firewire driver.  Very annoying.  I can't find any concrete evidence of this from other users on any of the forums that have my particular problem, but from my own testing, it's all I can conclude.
    I have 2 other things I can try:
    1.  Opening the laptop and looking at the firewire to maybe find appropriate driver (ugh, I don't want to have to open this thing up).
    2.  Upgrading to Win7x64bit Pro and possibly testing with XP on the new MS Virtual PC (http://www.microsoft.com/windows/virtual-pc/).  I can't do it with my Home edition apparantly.
    Who needs to view video on an external TV anyways....sheeesh...(scarcasm).
    Tim

  • Strange problem with Adobe Acrobat X (crash without a trace)

    Hi,
    I have a strange problem with Adobe Acrobat. It happens totally randomly, it leaves no signs in system logs.
    What is happening: during my work Adobe Acrobat sudennly crashes. After a crash I cannot run it again - system seems to do something for a second, but then nothing happends. When i look into taks manager - there are no processes of Acrobat.exe. It just doesn't want to run. What I need to do is to reinstall whole Adobe Acrobat - which requires restart.
    I've already tried to restart system after crash, it doesn't help - reinstall is required.
    Sometimes everyting is fine for a 3 months, sometimes crash happens a week after the previous one. It also happens in very different situations (somtimes  while opening a file, sometimes when doing something simple, sometimes in more complex tasks).
    Has anyone encountered a similar problem?
    Acrobat version: 10.1.1
    System info: Windows 7 64 bit

    Hi Kelvin,
    Please let me know what OS version you are using.
    The error also shows OS requirements not met.
    Futher please try the steps below :
    > Enable the hidden Admin Account on Windows 7 ( Ref :  http://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-wi ndows-vista/ )
    > Disable all Non-Microsoft Startup Services. (Ref : http://helpx.adobe.com/x-productkb/global/disable-startup-items-services-windows.html )
    > Disable all the Antivirus softwares like CA, Norton,Mc Afee etc. temporarily from the computer.
    Reboot and try installing in the new enabled Admin user account and check.
    Please refer the Kb Doc : http://helpx.adobe.com/creative-suite/kb/error-exit-6-exit-7.html.
    Also see Troubleshoot with install logs | CS5, CS5.5, CS6 - http://helpx.adobe.com/creative-suite/kb/troubleshoot-install-logs-cs5-cs5.html for information on how to review your installation logs
    Regards,
    Rave

  • Report with Union

    Hello Gurus
    I have a report with UNION of 3 criteria and the result i am getting is one of the columns is a union of 3 columns like Age Group,Gender and Race and here the problem is i need to show them in order Race first, Age Group, Gender now it is showing in sorting order even though i cleared sort on all the columns 65+,75+,85+, Asain, Black,Female,Hispanic,Male instead i want the column to show me Asian, Black,Hispanic, 65+,75+,85+,Female, male also in that table i want to make the table line thicker after race category and Age Group
    Thanks
    RC

    user1146711 wrote:
    Hello Gurus
    I have a report with UNION of 3 criteria and the result i am getting is one of the columns is a union of 3 columns like Age Group,Gender and Race and here the problem is i need to show them in order Race first, Age Group, Gender now it is showing in sorting order even though i cleared sort on all the columns 65+,75+,85+, Asain, Black,Female,Hispanic,Male instead i want the column to show me Asian, Black,Hispanic, 65+,75+,85+,Female, male also in that table i want to make the table line thicker after race category and Age Group
    Thanks
    RCTry this:
    1) In each of your three separate queries, add another column.
    2) Create BINS according to how you want the final report be sorted: Asian = '1', Black = '2', etc...
    3) Sort on this column in the combined query.
    Since each query will have the proper number assigned to the group, the report will sort as you wish...

  • Strange problem with ACLs

    Hi,
    I have just migrated an oracle database from 11.1.0.7 on Win Server 2003 to 11.2 on Linux 64 bit. I am having a strange problem with ACLs - I can create the ACL but when I perform either of the following two commands:
    SELECT * FROM DBA_NETWORK_ACLS
    or
    SELECT * FROM NET$_ACL
    I get no rows returned. The ACL exists somehow because if I try and create it again I get the error that it exists. Has anyone got any advice here? Something is out of sync and I need to know how to fix it up.
    Thanks
    Adam

    BEGIN
    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (
    acl => 'email_server_acl.xml',
    description => 'Network connection Email Server',
    principal => 'MAIL',
    is_grant => TRUE,
    privilege => 'connect');
    END;
    PL/SQL procedure successfully completed.
    select * from DBA_NETWORK_ACLS;
    (no rows)
    BEGIN
    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (
    acl => 'email_server_acl.xml',
    description => 'Network connection Email Server',
    principal => 'MAIL',
    is_grant => TRUE,
    privilege => 'connect');
    END;
    ORA-31003: Parent /sys/acls/ already contains child entry email_server_acl.xml
    ORA-06512: at "SYS.DBMS_NETWORK_ACL_ADMIN", line 252
    ORA-06512: at line 2
    Edited by: Adam J. Sawyer on 15/04/2011 17:08

  • Strange issue with external monitor, only working when external speakers plugged in

    Hey – I am having a very strange issue with my external monitor; where it only works if my external speakers are plugged in and connected.
    I am using a late 2011 Macbook pro, running Mavericks 10.9.4, along with an MBox 2 (USB Audio Interface), and two powered speakers (KRK Rokit 5). This setup has had no issues. I have just acquired an external monitor (Benq T2200HD), which I am using with a thunderbolt to VGA adaptor (a cheap non-apple adaptor).
    To start - I plugged the monitor in with the thunderbolt adaptor, and it powers up and works fine. However, there is a nasty buzz coming from the speakers. I did some research and it looks like a simple ground loop issue. I did a bit of troubleshooting, and this is where things get weird.
    What I found is - If I unplug the MBox, the monitor loses signal from the computer (displaying ‘No Signal Detected!’). Further, if I keep the MBox plugged in, however unplug both the cables from the MBox to the speakers, the monitor loses signal. It doesn’t matter if the speakers are turned off, however they need to be plugged in (or the monitor loses signal). Weirder still, I can unplug the MBox, however the monitor will work if I plug in the speakers through my macs headphone jack.
    Simply put, the monitor only works if there is a direct connection between the computer, the speakers, and the power source.  What is going on here? Is the monitor grounding through the computer port, to the speakers (I don’t know how this works, is this possible?). Could it somehow be the cheap VGA adaptor I am using?
    Some other information:
    - Everything is plugged into the same multi-box for power. I have tried plugging things into separate sources, and the result is the same.
    - If I unplug the thunderbolt adaptor, then the speaker noise disappears straight away.
    - The ground noise doesn’t appear in my headphones, which are plugged into the MBox.
    Any information would be great – am I missing something here, or is this genuinely weird?

    Hello cgoldberg11
    Please go to the below link to test if you are having a speaker hardware failure.
    Testing for Hardware Failures (Windows 7)
    This will rule out hardware failure, let me know how that goes.
    Thanks
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP. .....
    Reguards,
    Mo

  • Strange Problem with ARD 2.2 *Please Help*

    Strange Problem with ARD 2.2 (2 problems)
    We have a classroom lab with 14 G5 PPC's running 10.4.11 with ARD 2.2 clients installed.
    We controlled all the G5's from a PPC Mac Mini running 10.4.11 with ARD 2.2, this was our Admin machine in our server room.
    We then added a teachers machine in the lab, an iMac PPC running 10.4.11 and ARD 2.2 also with admin status.
    Everything was working fine!
    We then upgraded the iMac PPC to an iMac Intel with 10.4.11. We installed ARD 2.2 admin and did the intel intergration.
    Everything worked fine.
    The iMac PPC was moved to another location, ARD was removed following instructions on the Apple website telling us to delete the application then run some terminal commands to remove pref's.
    Then our Intel iMac screen broke, we had the "lines" problem so bad only half the screen was visible. Long story short Apple wanted to charge us almost half the cost of the machine (no Applecare as it was a donated machine) to repair the screen!
    So we moved the PPC iMac back into the lab, re-install ARD 2.2.
    Now here is the problem, I can control, observe and run almost any command but cannot share with any computer!
    2nd,the Mac Mini Tech computer is running fine but cannot control or observe the PPC iMac teacher machine (we were able to do this before) I can even share the Mac Mini with the iMac but cannot observe or control!!
    Any ideas?

    "With ARD you have to enable option to control a Mac which has ARD running on it as opposed to remotely controlling normal client Mac."
    I'm not sure I understand, do you mean in System Pref's under sharing? Or is there somewhere else I need to enable to control?
    Seems like a hassle to reinstall the entire OS just to fix this problem, I am able to do everything else, except observe from one admin to another, and control from 1 admin to clients.
    thanks

  • How to create VO with multiple dynamic where clauses on select with UNION?

    I am trying to implement the View Object for the UNION query that looks like this:
         select a,b,c...
              from t1,t2,...
              where dynamic_where_clause1     
         union all
         select a,b,c,...
              from t11,t12, ...
              where dynamic_where_clause2
    There are up to 60 input parameters that are used to generate dynamic where clauses. They are actually created by calling PL SQL function.
    So far, I was not able to assign both where clauses to the view object. Is there a workable solution for this problem, besides resorting to programmatic View Object?
    I understand that recommended way with UNIONs is to wrap both queries into a parent select:
    select * from (
         select a,b,c...
              from t1,t2,...
              where ... -- table relationship joints
         union all
         select a,b,c,...
              from t11,t12, ...
              where ... -- table relationship joints
    ) QRSLT
         where dynamic_where_clause
    Unfortunately this approach doesn't work here, since individual selects are producing unmanageable amount of data and resulting query takes forever to complete.

    I afraid I would not have any real benefits from using VO if I replace the entire query with every request. Actually, the performance may suffer.
    I solved the problem by creating a POJO Data Control and invoking the custom select query from java. Not sure if it is the best approach to the problem, but implementation time is limited and it works.
    Actually, this is not the first time I see the need to implement VO with complicated SQL like select with unions and dynamic pieces. It would be nice to find a solution and not resort to workarounds.
    Edited by: viksicom on Aug 2, 2012 8:48 AM

  • SQL statement with union clause

    Hi,
    I have a scenario where i need to generate a sql statement with UNION .
    Eg:
    SELECT B.YY_ID,
    FROM XXXX.YY B
    WHERE (B.YY_TY= 'as')
    UNION
    SELECT B.YY_ID
    FROM XXXX.YY_ALT_NAME A, XXXX.YY B
    WHERE (A.YY_TY= 'zx'
    AND (B.YY_ID=A.YY_ID)"
    I tried ns1:table1() union ns3:table2() in XQuery.
    But it is pushdown as 2 seperate sqls.
    Is it possible to create XQuery that pushdown as SINGLE SQL statement with union clause ?
    Thanks

    No. See 3.1.1.5 in the document I referenced in your previous post.

  • Query with union

    Hi,
    I have three table:
    Candidates: (candidate_id primary key)
    Purhcase_orders: (Po_number primary key)
    Bids: (bid_number primary key)
    Just wanted to retrieve candidate information like candidate_id, first_name etc, along with count of purchase orders issued against this candidate and count of bid_number.
    For that I have written below query:
    query - 1:
    SELECT CANDIDATE_ID,
    INITCAP (first_name) FIRST_NAME,
    +(SELECT COUNT (DISTINCT bid_number)+
    FROM bids
    WHERE BIDS.CANDIDATE_ID = cand.candidate_id)
    BID_COUNT,
    +(SELECT COUNT (DISTINCT po_number)+
    FROM purchase_orders po
    WHERE PO.CONTRACTEE_ID = cand.candidate_id)
    PO_COUNT,
    +'Y' match_flag,+
    DECODE ( (SELECT candidate_id
    FROM v_ineligible_candidates vic
    WHERE VIC.CANDIDATE_ID = cand.candidate_id),
    NULL, 'N',
    +'Y')+
    INELIGIBLE_FLAG
    FROM candidates cand
    Based on business requirement, need to create another set of query (query -2) same like above. In that we have some decode statements to calculate match_flag, then need to perform UNION operation between query -1 and query -2.
    have around 130563 number of rows in candidates table.
    Individually both queries are taking 500 msec.
    But when I have used union, it didnt give result for atleast 60 sec. Then I cancelled execution.
    Execution plan for the final query with UNION: (final cost)
    Cost: 2,873  Bytes: 9,130,170  Cardinality: 260,862                
    Please help me in this issue.
    Why its taking that much time in union.
    Please correct my mistake and suggest me in this query.
    UNION ALL is running but not UNION.
    Thanks in advance

    Please post complete Explain Plans.
    To get detailed information of Explain Plan use
    explain plan for
    your_query;
    select *
      from table(dbms_xplan.display(null, null, 'ALL'));Post it alongwith below details between {noformat}{noformat} (exactly as specified) tags to preserve formatting and ease of understanding.
    On your requirement,
    Using UNIONALL you will get two set of rows, with UNION you might get a single row if your MATCH_FLAG are same for both queries. Use of either, has to meet your requirements than to meet your performance. If it is Business Acceptable, then look for performance and tuning.
    If you could do the folllowing, it might be helpful for you.
    1. Post the Sample table structure (Table information of Candidates should suffice) in a Create Table/With Sub-Query clause.
    2. Sample Data in Insert Into/With Sub-Query format.
    3. Expected Outcome based on Sample data
    4. The Explain Plan of your Queries as requested above.
    Reason of asking these details are, there might be a way to avoid Hitting the table Twice and avoid use of UNION/UNIONALL clauses.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for