Can I eliminate '0' in Union Clause?

Hi,
My Output is ,
select to_char(duedate,'yyyymm') duemth,count(duedate) cntduedt,0 cntwrkdt from a1
group by to_char(duedate,'yyyymm')
union
select to_char(nonworkdate,'yyyymm') duemth,0 cntduedt, count(nonworkdate) cntwrkdt from b1
group by to_char(nonworkdate,'yyyymm');
DUEMTH     CNTDUEDT     CNTWRKDT
200502     0     2
200502     1     0
200503     1     0
200506     1     0
200511     0     1
200512     0     1
200512     1     0
My Required Output is,
DUEMTH CNTDUEDT CNTWRKDT
200502 1 2
200503 1 0
200506 1 0
200511 0 1
200512 1 1
Can anybody write a query for my req.?
Thanks in Advance,
SSV Hari.

1  select deptno,dname,null empno
2  from dept
3  union
4  select null,ename,empno
5* from emp
QL> /
   DEPTNO DNAME               EMPNO
       10 ACCOUNTING
       12 fgdfgdfgdfgd
       20 RESEARCH
       30 SALES
       40 OPERATIONS
       60 TEST
       70 TEST
          ADAMS                7876
          ALLEN                7499
          BLAKE                7698
          CLARK                7782

Similar Messages

  • Union clause cut off decimal places?

    Dear all,
    I am trying to create a query with "union" clause (to join 3 parts of records).
    If I run them separately, I got the figures in Qty field (of Bill of Material) with 3 decimal places.
    However, I only got 2 decimal places, when I combined the 3 sub-queries.
    Any idea please?
    Many thanks
    Yang
    Edited by: Y on Jul 10, 2009 4:16 PM

    Dear all,
    I just tried to create a view in the database for the "union" query, and I can see it is a 6 decimal numeric field from the SQL sever management studio, as all data are displayed fine.
    Unfortunately, I queried this view in SAP query manager, and it is still showing only 2 decimals ... 
    I am very keen to know if there is a solution.
    However, for now, I have let the view join the ITT1 table again in SAP to use the qantities figures.
    It seems that SAP only shows 2 digit for numeric fields, unless it is getting data from a generic data table?
    Cheers
    Yang

  • How can I eliminate delays in one NIC when there is traffic on second NIC

    Using LabVIEW TCP/IP VIs, my LV application is  accessing a database though a LAN, and  through a second NIC, it is controlling an instrument.  The instrument is connected directly to the computer NIC with a cross-over cable.  I have made a permanent route for the IP address of the instrument in the IP route table.  The LAN and the instrument have different subnet numbers.  Using a packet sniffer, I don't see any traffic meant for the LAN going to the NIC connected to the instrument.  The OS of the computer is Windows XP and the NICs are PCI cards.
    The message traffic to the instrument suffers from intermittent delays when there is traffic going to the LAN. 
    How can I eliminate the delays?  What could be the cause of the delays?  Thanks in advance for your recommendations and suggestions.

    Hi LabBard,
    Could you tell us a little more about the device that you are connected to? What you could try is to have a VI accessing the LAN, and a separate VI communicating with the instrument, and see how things play out.
    Let us know how it goes!
    Rasheel

  • I am trying to get space on an external hard drive which has some old time machine back up files that I do not need but can not eliminate, even by going into the time machine, clicking on the backup file to be eliminated and using the drop down eliminate

    I am trying to get space on an external hard drive which has some old time machine back up files that I do not need but can not eliminate, even by going into the time machine, clicking on the backup file to be eliminated and using the drop down menu with the gear box symbol to eliminate

    I cannot find this 300GB "Backup" in the Finder, only in the Storage info when I check "About This Mac".
    You are probably using Time Machine to backup your MacBook Pro, right? Then the additional 300 GB could be local Time Machine snapshots.  Time Machine will write the hourly backups to the free space on your hard disk, if the backup drive is temporarily not connected. You do not see these local backups in the Finder, and MacOS will delete them, when you make a regular backup to Time Machine, or when you need the space for other data.
    See Pondini's page for more explanation:   What are Local Snapshots?   http://pondini.org/TM/FAQ.html
    I have restarted my computer, but the information remains the same. How do I reclaim the use of the 300GB? Why is it showing up as "Backups" when it used to indicate "Photos"? Are my photos safe on the external drive?
    You have tested the library on the external drive, and so your photos are save there.  
    The local TimeMachine snapshot probably now contains a backup of the moved library.  Try, if connecting your Time Machine drive will reduce the size of your local Time Machine snapshots.

  • How can I eliminate a green rectangle showing up after exporting?

    After exporting in FCP and viewing in Quicktime, a green rectangle on the right side of the Quicktime window is showing up for about 1 second at a point where there is black between two clips with fade in/out transitions. There is a slug there which I thought might have something to do with it. I tried deleting the slug but the green rectangle persists. Can anybody help me eliminate this green monster?

    Nick-- Thanks so much for your reply.
    CODEC is H.264.
    In Sequence Settings I have the Quicktime Video Settings Compressor set to HDV 1080i60.
    After rendering and saving the sequence, I click
    File >
    Export >
    Using Quicktime Conversion. After window opens to save the file
    Format: Quicktime Movie
    Use: Most Recent Settings
    I click "Options" >
    Settings, I choose H.264, then click OK (the green rectangle appears regardless of quality setting (I tried 2 kinds: Best and Hight), (also, encoding doesn't matter, either. I tried Multi-pass and Single-Pass)
    Click Size, choose NTSC 720 x 480 16:9 (using this just for a smaller file to FTP to show progress)
    I then uncheck Sound and Prepare for Internet Streaming (no soundtrack on this yet), then click OK
    I then click Save.
    As I mentioned I tried it several different ways and each time the green rectangle shows up. I am nearing the end of this project and this is really becoming a problem. I hope you can help eliminate it. If you would like to see it I can email a small few second clip that will show it.
    Thank you again--

  • I can not eliminate ASK engine from the list. It came back by itself. Please, tel me how I can eliminate this problem. Another problem, this browser is no longer compatible with some institutions. This new version might have some problems.

    '''I can not eliminate ASK engine from the list. It came back by itself. Please, tel me how I can eliminate this problem.
    Another problem, this browser is no longer compatible with some institutions. .'''

    Step by step, how did you arrive at seeing this agreement?

  • 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

  • When syncing my iphone 6 plus, i now get an error that reads, "IP address conflicts with another system or network."  How can i eliminate this error permanently?   Thank you in advance!

    when syncing my iphone 6 plus, i now get an error that reads, "IP address conflicts with another system or network."  How can i eliminate this error permanently?   Thank you in advance!
    This never happened before, however the last couple of months it comes up every time I plug my USB from PC to iphone.

    HyperNova Software,
    Thank you so much.  Because I am very computer illiterate, could you help me on how to get started?  I don't have the slightest on where to get started, the steps to follow, etc.
    Can't thank you enough for your help!

  • I'm trying to clean up extra iPhoto positions. What other folders and files can I eliminate?

    I have too much redundancy. iPhoto Libraries have been started over the last couple of years without much thought to structure.  If I identify and remove the picture files in "Originals" and "Modifieds" (identified by using "Show Package Contents") and move them to secure locations (designated folders on another drive) what other files can I eliminate? Inside of "Show Package Contents" I see folders for Data.noindex, Library.iphoto, Contents, and Metadata Backup? Other files show as well.  Can these be eliminated or do they contain critical picture files?  I'm working with iPhoto Manager to identify and manage libararies.

    Whoa!
    Don't change anything in the iPhoto Library Folder via the Finder or any other application. iPhoto depends on the structure as well as the contents of this folder. Moving things, renaming things,, deleting them or otherwise making changes will prevent iPhoto from working and could even cause you to damage or lose your photos.
    I don't know anyway to make things clearer.
    What are you trying to do?

  • How can I eliminate duplicates in Outlook

    My iPhone 4 and iMac (Outlook) were out of sync. I synced them through iTunes and I now have duplicates in Outlook. How can I eliminate them in Outlook. My thought is to sync my iPhone with Google Contacts, eliminate the duplicates, and somehow load them into Outlook. Is that the best way to go, or is there an easier way?

    If you are trying to sync from the Outlook calendar on the PC and you are syncing with iCloud - that is probably why you are getting duplicate entries.
    So therefore, if you are getting duplicate entries - it must be syncing the Outlook calendar on the PC.

  • How can I eliminate automatic "quotation marks" that are appearing at the end of each line?

    I keep getting "quotation marks" at the end of every line when I type. How can I eliminate these marks as they are even showing up when I print and I will not have on my wedding programs! Please help (from a desperate bride-to-be)!

    It sounds like you are using an East Asian font and unless you are issuing invitations in Chinese, Japanese, or Korean that doesn't sound like a good idea.
    Peter

  • Query can't include an "ORDER BY" clause when having column heading sorting

    I'm getting the following error when I try to include "ORDER BY" in my sql statement :
    "Your query can't include an "ORDER BY" clause when having column heading sorting enabled"
    I have used other sql statements with "ORDER BY" but this is the first time I have come across this and I don't understand why it's going wrong. Does anyone have a suggestion as to how I could fix it? Here is one of the sql statements which I have tried which is giving me the error:
    select "ID_NUMBER",
    "PROJECT_NAME",
    "PROJECT_TYPE",
    "OWNER",
    "PRIORITY",
    "STATUS",
    "END_DATE",
    "COMMENTS"
    from "PROJECT"
    WHERE "STATUS" != 'Completed' AND "STATUS" != 'Cancelled'
    ORDER BY "END_DATE"
    Regards,
    Ed.

    You must deselect column heading sorting that is in the page "Report Attributes" .This is a check box placed on the same line of the element of the report.
    bye

  • Can i use Decode in Where clause

    Hi,
    Can i use Decode in Where clause Please Do the need full on the same.
    Thanks,
    Sanjeev.

    set serveroutput on
    DECLARE
    posn  PLS_INTEGER := 0;
    empid PLS_INTEGER := 178;
    x     NUMBER;
    BEGIN
      SELECT NVL(SUM(ah.quantity * ah.saleprice * ap.payoutpct), 0)
      INTO x
      FROM accessoryhistory ah, payoutpercentage ap,
      sku s, store st
      WHERE empid = DECODE(posn,
                              0, st.areadir,
                              1, st.areamgr,
                              2, NVL(st.storemgr1, st.storemgr2),
                              3, NVL(st.asstmgr1, NVL(st.asstmgr2,
                           st.asstmgr3)))
      AND ah.statustype IN ('ACT', 'DEA')
      AND ah.store = st.store
      AND s.dbid = ah.dbid
      AND s.sku = ah.sku
      AND ap.productgroup = s.productgroup
      AND ap.position = posn;
      dbms_output.put_line(x);
    END;
    /http://psoug.org/reference/decode_case.html

  • 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.

  • Can i assign an 'order by' clause dynamically in forms ??

    I know it's possible to assign an 'order by' clause in reports with lexical parameter.
    for example..
    select A
    from TABLE
    where A is not null
    &V_ORDERBY
    In this, v_orderby might be 'order by name' like that,,,
    can i assign an 'order by' clause dynamically IN FORMS ??
    If you understan my question, please answer to me,,,ㅜㅜ

    Have you tried this build-in function?
    SET_BLOCK_PROPERTY('[BLOCK_NAME]', ORDER_BY, 'SORTCOL1, SORTCOL2...');
    Where 'SORTCOL1, SORTCOL2...' are the table columns name.

Maybe you are looking for

  • Fault while calling a Web service using SOAP 1.2

    Hi , I have created a simple PL/SQL web service using Jdeveloper from PL/SQL using SOAP 1.2. But while i call that from PL/SQL, i am getting a version mismatch. While the same service created from SOAP 1.1 is working fine. Can anyone Help???

  • Permissions Changed After File Transfer

    Yesterday, I received a new 21.5" iMac. I transferred my files and settings from an older MacBook PRO (Core 2 Duo). Now, most of my programs don't recognize me a the same (?) user, and say that there is a problem with my "permissions" (like when Ligh

  • [AS][IDCS3] PDF Export Preferences Color Conversion setting

    I want to set the field of Color Conversion (as equivalent to manual setting under Output>Color>Color Conversion) to "No Color Conversion" in Applescript but couldn't figure it out. My skeleton Applescript is as follow:- tell application "Adobe InDes

  • Install files to desktop in MXI file

    What is the proper syntax to place files on the desktop (PC/MAC) in an MXI file? ex. <files>       <file source="sourceFiles" destination="???????????"/> </files>

  • Using IN and TABLE operators via JDBC

    Greetings, Hope this may be of benefit to someone. Any and all feedback greatly appreciated. import java.math.BigDecimal; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.sql.DataSource; import or