Data selection in UDB where columns were named after the oracle data types

I have a couple of tables in UDB, I'm trying to reference on a HS db link.

The first table on the side of the UDB has a column named 'number' (bought the software - not something we did)...

Selecting this SEO column in this table and more specifically (i.e. Select number, col2, col3 etc) causes the error ORA-00936 (missing expression).

Select * works...

The second table also has a column called 'number', so the same problem above applies.  [However, sql errors when I do a select * from ORA-00600: internal error code, arguments: [HO set: look long], [], [], [], [], [], [], [], [], [], []]

Our dba lean on it, - Oracle HS is new to us, so - I was hoping someone here might have an idea...

Using oracle 11.2.0.3.0.

When your DB2 database has column with reserved words in Oracle names, you must create a view of your DB2 side by specifying a different name for this column, and then use DG4ODBC to choose from the scoreboard instead of DB2.

Another approach which would require an additional programming is to use the DBMS_HS_PASSTHROUGH that allows to make statements that they are to the DB2 database without be analyzed in Oracle.

As for the ORA-600 error that you get this error is caused when your DB2 table contains certain character inspired columns that exceed the accuracy of the Oracle and are then mapped to the Oracle long data types. Normally in Oracle each table can have a long column. But to be able to select with the gateways of databases foreign this restriction has been slightly improved and more recent Oracle software can choose from the tables that contain more then a long.

So, could you please be more specific what program you use to select using the gateway fails with ORA-600 and could you please post your description of the table as it is stored in your DB2 database as seen using the gateway in SQL * more: desc (your DB2 table > @)

-Klaus

Tags: Database

Similar Questions

  • Execute "dbms_stats.gather_table_stats in the start = > run until the peak hours = > pause = > restart from where he was arrested after the rush hour" mode.

    Guys,

    Please let know us if it is possible to run dbms_stats.gather_table_stats in "start = > Execute until off-peak hours = > take a break during peak times = > restart from where he was arrested after the rush hour" mode.

    I partitioned table with mammoth number of records requiring full table statistics collection once all 3 months. Stats gathering is so expensive that it takes almost 2 days to complete.  Our goal is to ensure that no SQL that runs during peak hours (15:00 to 22:00 hours) is affected by the collection of statistics. That's why we would like the stats collection to run above mode.

    Ideas, suggestions would be very appreciated and I will receive with the profound esteem.

    -Bugs

    Like others, I wonder why full stats are required.

    You nightly stats together people with reduced mobility?

    Check dba_tab_modifications for the changes made to the table, your stats every night, whether its stats are needed comes from there so if a partition has no 10% change, why you re - collect his stats for her?  There are a few other things going on behind the scenes, but close enough.  Even if you set additional stats there and kick that off, he'll simply choose the following who did not, risking several work trying to do the same thing

    theres probably 10 different ways to act how you're good with plql but generate your work statistics with something like that, then open multiple windows of sqlplus and divide it into sections while you are in the collection of statistics on several pieces at the same time.    Failure could write some autonomous plsql proc that analyzes a partition that went in there and call that any amount of time passing in the partition in a loop, but you get the idea of gathering statistics on more than one partition at the same time.

    Change the value of table_owner and table_name

    exec DBMS_STATS. FLUSH_DATABASE_MONITORING_INFO;

    Select the command from

    (select (nvl(a.updates,0) + nvl(a.inserts,0) + nvl(a.deletes,0)) * 100)

    / nvl(b.num_rows,1) as change.

    "exec DBMS_STATS. GATHER_TABLE_STATS (' |) '''' || "TABLE_OWNER" | '''' || ',' || '''' || 'TABLE_NAME ' | '''' || ', granularity =>' | '''' || 'PARTITION | ''''||  ', PARTNAME =>' | '''' ||  a.PARTITION_NAME | '''' || ', ESTIMATE_PERCENT => DBMS_STATS. AUTO_SAMPLE_SIZE, METHOD_OPT => ' | '''' || 'FOR ALL COLUMNS SIZE AUTO ' | '''' || ')' as a command

    of dba_tab_modifications a, b dba_tab_partitions

    where a.table_name as "TABLE PARTITIONNEE YOUR BIG".

    and a.table_name = b.table_name

    and a.partition_name = b.partition_name

    and nvl(a.updates,0) + nvl(a.inserts,0) + nvl(a.deletes,0) > 0

    )

    where to change > = 10

  • will be all my files get saved or new that were created after the death of this drive?

    I'm in Windows 8.  I had an external drive that I had put in place to save on file history.   This drive is dead.  I have since bought a new and I'm setting up historical files to copy to the disc.  He asked me if I would like to move files to this player of the former.  Of course, I can't.  He's dead.  I said no and it seemed to go.

    My question is: are all my files get saved or new that were created after the death of this drive?

    If she's not aging files saved on it, how can I get all my files copied?

    Hi Becky,

    Please contact Microsoft Community,

    As you have said that your return to the history of files on external Drive that got crashed, and then you bought a new external drive and set up again for the backup.

    I want to tell you that unfortunately, it will only back up recent files that you created on the new drive. Steps to recover old files is not possible that the backup was created on the external pilot who already got crashed.

    To learn more details of the history files, please see the link:

    https://TechNet.Microsoft.com/en-us/magazine/dn448546.aspx

    Hope this information helps. Feel free to contact us again for assistance.

  • where is mocha in after the effect cc and cs6

    where is mocha in after the effect cc and cs6 I foud associated anaything

    Mocha AE is not a separate application that you access or put it in After Effects. You use of After effects.

    See After Effects help for more details:

    http://helpx.Adobe.com/after-effects/using/tracking-stabilizing-motion-CS5.html

  • How to get the column provided out of the Oracle Data Miner?

    Hi all!

    I use Oracle Data Miner provided with Oracle SQL Developer to predict the loss of customers. If I plan on the table column lets say X (as a target column) of table say T, so how can I get the corresponding values under my model?

    Here is the simplified model for the reference.

    Thanks in advance!

    Customer churn.PNG

    Hello

    Simply connect a node that accepts data to the node to apply it.

    For example, if you want to create a view or table table using the prediction of outputs generated by the node to apply it, and then add a Create Table node and connect the node to apply it.

    For more information, try the Oracle by example tutorials for ODMr.

    You must use the node apply Publisher to revise prediction outputs models to generate as well as the additional columns to include, for example columns id.

    There are a set of predictor columns added by default that may be acceptable.

    THX, mark

  • Selection of rows where column string contains special characters.

    Hey there,

    Im trying to select rows based on a column containing a bar slash.

    I tried

    where substr (col1, INSTR(col1,'/'), INSTR(col1,'/') + 1)

    but no luck, is there a special way to treat this?

    Thanks in advance,
    Date of birth
    instr (str, '/') > 0
    

    as in

    SQL> with test
      2  as
      3  (select 'this first string contains / a slash' str from dual union all
      4   select 'this second string contains / a slash' str from dual union all
      5   select 'this third does not' str from dual
      6  )
      7  select *
      8    from test
      9   where instr (str, '/') > 0
     10  /
    
    STR
    -------------------------------------
    this first string contains / a slash
    this second string contains / a slash
    
  • Identity columns were kidnapped in the database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit?

    Hey all,.

    I am able to create the following table in my environment. However, in our QA environment, it fails with the following error:

    Error report:

    SQL error: ORA-02000: missing (keyword

    02000 00000 - "missing %s keyword."

    Originally, we got the error described in this stack overflow thread until I changed:

    GENERATED BY DEFAULT AS IDENTITY

    TO:

    PRODUCT ALWAYS AS IDENTITY


    Here is the code and specifications:


    Table:

    CREATE TABLE table1)

    NUMBER (10) ID GENERATED ALWAYS AS IDENTITY

    );

    Environment:

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production

    PL/SQL Release 12.1.0.1.0 - Production

    CORE Production 12.1.0.1.0

    AMT for 64-bit Windows: Version 12.1.0.1.0 - Production

    NLSRTL Version 12.1.0.1.0 - Production

    QA environment: (this returns the error)

    Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production 0

    PL/SQL Release 12.1.0.2.0 - Production 0

    CORE 12.1.0.2.0 Production 0

    AMT for 64-bit Windows: Version 12.1.0.2.0 - Production 0

    NLSRTL Version 12.1.0.2.0 - Production 0

    It works for me!  You specify "GENERATES DEFAULT ON NULL AS IDENTITY?

    CREATE TABLE table1)

    NUMBER (10) ID GENERATED BY DEFAULT TO NULL AS IDENTITY

    );

    Table created.

    Select * from product_component_version;

    PRODUCT VERSION STATUS
    NLSRTL 12.1.0.2.0 Production
    Oracle Database Enterprise Edition 12 c 12.1.0.2.0 64 bit Production
    PL/SQL 12.1.0.2.0 Production
    AMT for Linux: 12.1.0.2.0 Production
  • Where discoverer reports stored in the oracle database

    Hi Experts,

    I read the Forum of previos for the same topic, but I have not found the answer by reading this thread.

    I want in the database where are stored the exactly discover reports, I would like to list the responsibility of reports wise.

    I also check the table of EUL5_Documents by the owner of the END user license, but this did not help me.

    Please kindly look at this problem I stuck with that of the last two days.

    Any help would be appreciated.

    Thank you
    Atul.

    Hi Atul;

    Please see below note:
    To find who the owner of a workbook what and to whom it is shared [1076907.6 ID]

    Also try under request;
    SELECT
    a.doc_name disco_report,
    incongruous d.responsibility_key
    EUL5_DOCUMENTS has
    B EUL5_ACCESS_PRIVS,
    EUL5_EUL_USERS c,
    FND_RESPONSIBILITY d
    WHERE
    a.doc_id = b.gd_doc_id
    AND b.ap_type = 'GD '.
    AND b.ap_eu_id = c.eu_id
    AND REPLACE (c.eu_username,' #', ") TO_CHAR (d.responsibility_id) | To_char (d.application_id);

    Source:
    http://Oracle.ITtoolbox.com/groups/technical-functional/Oracle-Apps-l/discoverer-reports-1060199

    Respect of
    HELIOS

  • Cfquery results sorted by column being added after the query to execute

    I have a function that returns a Recordset, adds a column using QueryAddColumn goes through the recordset and rearranges the elements using QuerySetCell.

    Once the function is executed, the output displays the elements in their natural order and lists the new order as a table column.

    How I can make the equivalent of ORDER BY myNewColumn because the query has already been run.

    My code is attached.

    Thank you
    Paul

    Never mind, sussed it!

    Add the following to query of query:

  • Satellite L670-11R - SD cards were not after the installation of recovery

    Hallo,

    After that I got a virus I couldn't find my SD cards in the workplace (I hope, be called 'place of work' in English').
    So I started the recovery of HARD drive and restore the system to the original terms.

    But now, I have the same problem:
    When I put an SD card in the slot, the dialog box in the lower right shows me, that the drivers have been installed, but I can't find my card. When I put the card SD and back, nothing happens... Only after reinstalling the card-slot-driver from the toshiba-homepage, I can see the dialog box by putting in the SD card. But even once only once and nothing else happens.

    So, I don't know if it's a hardware problem (the slot recognizes the card) or a driver problem (with exactly the same system that everything worked fine a year ago).
    Does anyone have an idea? If possible, please answer in German, if not, I would be very grateful for each answer.

    Timon

    Hello

    As far as I know the laptop L670-11R supports the Realtek card reader controller. I think you should try the Realtek Realtek driver page driver.

    Here you can find the latest version of the driver:
    * PCIE card reader driver for XP/Vista/Win7 *.
    http://www.Realtek.com.tw/downloads/downloadsView.aspx?langid=1&PNid=15&PFID=25&level= 4 & Conn = 3 & DownTypeID = 3 & GetDown = false

  • Pass the content of the variable named after the current object in the text box

    I am writing a drag and drop game and when an object is deleted I need information on

    This object is displayed in a text box.

    I've got objects moveable, put in place through a class.

    Within the class, I have set up with the text of each object such as variables

    var soaptext: String = "text of SOAP."

    for the object with the instance name SOAP.

    If I explicitly include the name of the variable:

    MovieClip (parent).text_box.text = soaptext;

    The required information is displayed, but if I try to get the name of the current object:

    MovieClip (parent).text_box.text = myIdName + "text";

    The box displays the name of the soaptext variable, but not its content.

    Is there a simple way to get this information to appear?

    Note - I have little experience and no training formal as3 so am hoping to keep things simple!

    You will need 4 movieclips with internal textfields on stage.

    Name them: liver, heart, SOAP, drive

    Another area of text ("message_txt", not inside a moviclip) will do the e-mail (tell which box was dragged on what other):

    For more elements create a loop that goes through an elementsarray with your name of elements inside

    soap.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    soap.addEventListener (MouseEvent.MOUSE_UP, showMessage);
    lead.addEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    lead.addEventListener (MouseEvent.MOUSE_UP, showMessage);
    soap.mouseChildren = false;
    lead.mouseChildren = false;

    function dragstart(e:MouseEvent):void {}
    e.currentTarget.startDrag ();
    }

    This targetArray can be improved for your needs

    var targetArray:Array = new Array ("liver", "heart");

    Object (this).heart.txt.text = this.heart.name;
    Object (this).liver.txt.text = this.liver.name;
    Object (this).liver.mouseChildren = false;
    Object (this).heart.mouseChildren = false;

    function showMessage(e:MouseEvent):void {}
    for (var i: uint = 0; i
    If (e.currentTarget.hitTestObject (getChildByName (targetArray [i]))) {}
    . Message_txt.text = e.currentTarget.name of the object (cela) "was dragged" + targetArray [i];
    e.currentTarget.stopDrag ();
    e.currentTarget.removeEventListener (MouseEvent.MOUSE_DOWN, opportunity);
    }
    }
    }

  • Is it possible to jump to a point of "security restart"... to where you were before?

    I had to reboot my computer and the screen suggested I choose resumes from a safe point...

    now - how you spend in this case there and get to the point where you were and before the machine froze and had to do a restart

    I'm afraid not. What is the exact message received at startup?

    Elaborate on "choose resumes from a safe point"?

    If you're referring to restore your applications open before the crash, the answer is no. However, browsers have the ability to restore the tabs if the computer crashed.

  • A question about the conservation of fields (hour, min, sec) time DATE type in the table on the changes of NLS_DATE_FORMAT

    Hello

    Oracle version: 12.1.0.1.0 - 64 bit

                      OS:   Fedora Core 17 X86_64

    My question is about the conservation of fields (hour, minute, second) time DATE type in the array on NLS_DATE_FORMAT changes.

    Take the following test case:

    SQL> create table tmptab(dateval date);
    
    Table created.
    
    SQL> alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
    
    Session altered.
    
    SQL> insert into tmptab(dateval) values('2014-01-01 00:00:00');
    
    1 row created.
    
    SQL> insert into tmptab(dateval) values('2014-01-01 10:00:00');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from tmptab;
    
    DATEVAL
    -------------------
    2014-01-01 00:00:00
    2014-01-01 10:00:00
    
    SQL> alter session set nls_date_format = 'yyyy';
    
    Session altered.
    
    SQL> select * from tmptab where dateval > '2014';
    
    no rows selected
    
    SQL>
    

    I don't understand why it returns nothing. The second test case above insert statement inserted a line with 10 as the value for the time of the DATE field column dateval.

    Accordingly, while comparing this with the literal '2014' (which based on the new value of NLS_DATE_FORMAT = "yyyy" is implicitly converted to DATE), shouldn't the above query returns the line 2014-01-01 10:00 ?

    I mean, I changed the NLS_DATE_FORMAT but data from time in the table fields are preserved and that's why they should normally be taken into account in the comparison of date.

    What I'm trying to say is that for me (Please correct me if I'm wrong), no matter what NLS_DATE_FORMAT configuration is the following test

    SQL> select * from tmptab where dateval > '2014';
    

    is the same thing that

    SQL> select * from tmptab where dateval > to_date('2014-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss');
    

    And because the line 2014-01-01 10: 00:00 in the tmptab table. The following test

    2014-01-01 10:00:00 > to_date('2014-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
    

    evolves normally true (beucase of TIME = 10 on the left side of the test) and therefore this line must be returned which is not the case in the test above.

    You kindly could you tell me what I misunderstood?

    Thanks in advance,

    This is the price for the use of implicit conversions. Implicit DATE conversion rules are not as direct as it can be assumed. In your case, all you provide is year as date format. In this case date implicit conversion rules assumes that month in the current month, day 1 and time as 00:00:00.

    SQL > alter session set nls_date_format = "yyyy";

    Modified session.

    SQL > select to_char (to_date ('2014 "), ' mm/dd/yyyy hh24:mi:ss') twice;

    TO_CHAR (TO_DATE('20)
    -------------------
    01/08/2014-00:00:00

    SQL >

    So, when you start:

    Select * from tmptab where dateval > '2014 '.

    Oracle implicitly converts date using "YYYY", which translates as August 1, 2014 '2014'. That's why your quesry returns no rows.

    SY.

  • Impact on performance when you use the LONG data type

    Hi all


    Only I have a doubt about the use of LONG data type

    I use the data type LONG for some columns in a table and I created indexes on the columns separately, but these column values can be easily fit into the varchar data type.

    (Just to see the performance on this issue)

    Suppose that a common select query with WHERE condition on any of the column which has LONG data type will affect the performance of the query?

    Please explain.

    Thank you

    (1) the LONG (and LONG RAW) data types have been depricated for quite a while. Oracle has been strongly recommends that you move to 8.1.5 CLOB and BLOB data types. Why you use the LONG data type? You're still on Oracle 7?

    (2) have you tried to write a query that has a WHERE condition that refers to a LONG column? In general, you can not because it does not support the type of data LONG. For example

    SQL> ed
    Wrote file afiedt.buf
    
      1  create table a (
      2    col1 varchar2(30),
      3    col2 long
      4* )
    SQL> /
    
    Table created.
    
    SQL> select * from a where col2='abc';
    select * from a where col2='abc'
                          *
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    

    LONG data types are a royal pain to work with. They also have implications on the performance of wicked on the client.

    Justin

  • Select only records where the column values are not all equal to zero

    Hi everyone, it seems so easy, but it has left me speechless on the research in a way that is clean, easy to achieve. I know when someone replies, I'm going to kick me. So, let's assume this is what I have:
    with mytable as (
    select 'Type 1' as itemtype, 'JAN' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'FEB' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'MAR' as monthname, 5 as theval from dual union all
    select 'Type 1' as itemtype, 'APR' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'MAY' as monthname, 4 as theval from dual union all
    select 'Type 1' as itemtype, 'JUL' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'AUG' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'SEP' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'OCT' as monthname, 7 as theval from dual union all
    select 'Type 1' as itemtype, 'NOV' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'DEC' as monthname, 2 as theval from dual union all
    
    select 'Type 2' as itemtype, 'JAN' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'FEB' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'MAR' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'APR' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'MAY' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'OCT' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'NOV' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'DEC' as monthname, 0 as theval from dual
    )
    select
      itemtype,
      sum (case monthname when 'JAN' then theval else 0 end) as JAN,
      sum (case monthname when 'FEB' then theval else 0 end) as FEB,
      sum (case monthname when 'MAR' then theval else 0 end) as MAR,
      sum (case monthname when 'APR' then theval else 0 end) as APR,
      sum (case monthname when 'MAY' then theval else 0 end) as MAY,
      sum (case monthname when 'JUN' then theval else 0 end) as JUN,
      sum (case monthname when 'JUL' then theval else 0 end) as JUL,
      sum (case monthname when 'AUG' then theval else 0 end) as AUG,
      sum (case monthname when 'SEP' then theval else 0 end) as SEP,
      sum (case monthname when 'OCT' then theval else 0 end) as OCT,
      sum (case monthname when 'NOV' then theval else 0 end) as NOV,
      sum (case monthname when 'DEC' then theval else 0 end) as DEC
    from mytable
    group by itemtype
    order by itemtype
    I need an external application around it or something which will select only 'Type 1'... that is, if all months are each equal to zero, do not include the record in the result set.

    In summary to get a total of zero is not an option, because I could have-15 and + 15 in different columns, in which case, the recording should be displayed.

    Something as simple as... 'not the case (oct = 0 and 0 nov and dec = 0...) at the end is all it seems to me necessary. I thought to add a case for each column clause, but that seems not very effective. Ideas?

    Thanks in advance!
    Mark

    Edit... I know not what follows will work using the MINUS operator, but my actual query is really huge, and I don't want to have to write it twice...
    {code}
    Select
    ItemType,
    sum (case monthname when "JAN" then Val else 0 end) such as JAN,.
    sum (case when monthname 'FEB', then Val 0 otherwise end) by Feb.
    sum (case when monthname 'MAR', then Val 0 otherwise end) like MARS,
    sum (case monthname when "APR" then Val else 0 end) as APR.
    sum (case when monthname 'MAY', then Val else 0 end) either.
    sum (case when monthname "JUN", then Val 0 otherwise end) as JUN.
    sum (case monthname when "JUL" then Val else 0 end) as JUL,.
    sum (case monthname when "AUG" then Val else 0 end) as AUG.
    sum (case monthname when "MS" then Val else 0 end) as MS.
    sum (case monthname when "OCTS" then Val else 0 end) OCT.
    sum (case monthname when "NOV" then Val else 0 end) as NOV.
    sum (case monthname when 'DEC' then Val else 0 end) as DEC
    FROM MyTable
    Group of itemtype

    less

    Select
    ItemType,
    Jan, Feb, mar, Apr, may, June, July, August, Sept, oct, nov, dec
    de)
    Select
    ItemType,
    sum (case monthname when "JAN" then Val else 0 end) such as JAN,.
    sum (case when monthname 'FEB', then Val 0 otherwise end) by Feb.
    sum (case when monthname 'MAR', then Val 0 otherwise end) like MARS,
    sum (case monthname when "APR" then Val else 0 end) as APR.
    sum (case when monthname 'MAY', then Val else 0 end) either.
    sum (case when monthname "JUN", then Val 0 otherwise end) as JUN.
    sum (case monthname when "JUL" then Val else 0 end) as JUL,.
    sum (case monthname when "AUG" then Val else 0 end) as AUG.
    sum (case monthname when "MS" then Val else 0 end) as MS.
    sum (case monthname when "OCTS" then Val else 0 end) OCT.
    sum (case monthname when "NOV" then Val else 0 end) as NOV.
    sum (case monthname when 'DEC' then Val else 0 end) as DEC
    FROM MyTable
    Group of itemtype
    )
    where (oct = 0 & nov = 0 and dec = 0 and jan = 0 and 0 = Feb and mar = 0
    apr = 0 and may = 0 and = 0 jun and Jul = 0 and aug = 0 and Ms = 0
    )
    order of itemtype
    {code}

    Change again... OK, I guess that I am answering my own question here, but I think that by using a WITH to write the main request once clause and then selecting * twice using the MINUS operator between where the second query is where (oct = 0, etc.) is what I need. If anyone has better suggestions, please let me know! Here's the logic of nickname for what I come up with to date...

    {code}
    WITH mainquery as (select all)
    Select * from mainquery
    less
    Select * from mainquery where (oct = 0, nov = 0, etc...)
    {code}

    Thanks again!
    Mark

    Published by: user455268 on March 1, 2012 19:13

    Published by: user455268 on March 1, 2012 19:16

    Hello

    You can do it with a HAVING clause:

    select
      itemtype,
      sum (case monthname when 'JAN' then theval else 0 end) as JAN,
      sum (case monthname when 'FEB' then theval else 0 end) as FEB,
      sum (case monthname when 'MAR' then theval else 0 end) as MAR,
      sum (case monthname when 'APR' then theval else 0 end) as APR,
      sum (case monthname when 'MAY' then theval else 0 end) as MAY,
      sum (case monthname when 'JUN' then theval else 0 end) as JUN,
      sum (case monthname when 'JUL' then theval else 0 end) as JUL,
      sum (case monthname when 'AUG' then theval else 0 end) as AUG,
      sum (case monthname when 'SEP' then theval else 0 end) as SEP,
      sum (case monthname when 'OCT' then theval else 0 end) as OCT,
      sum (case monthname when 'NOV' then theval else 0 end) as NOV,
      sum (case monthname when 'DEC' then theval else 0 end) as DEC
    from mytable
    group by itemtype
    HAVING      MIN (theval)     != 0
    OR      MAX (theval)     != 0
    order by itemtype
    ;
    

    If the values are all 0, then the MIN and MAX will be 0.
    If the MIN or MAX is not 0, the values are all 0.

    This assumes that the combination (itemtype, monthname) is unique, because it is in your sample data.
    If this is not the case, start with a subquery that GROUPs BY itemtype, monthname, so that when you get to the main request, this combination will be unique.

Maybe you are looking for