Difference of the results more than 1000

I have to write a procedure where if the results of the following result set varies by more than 1000 than it should sent out a paramter YES
COUNT(1)     TABLE_NM
42986     A_TBL
539     B_TBL
42986     C_TBL
42986     AD_TBL
so if the difference between the counts of any tables is more than 1000 then it should send YES.
can someone suggest?

SQL> create table tbl
  2    as
  3      select 42986 cnt,'A_TBL' table_nm from dual union all
  4      select 539,'B_TBL' from dual union all
  5      select 42986,'C_TBL' from dual union all
  6      select 42986,'D_TBL' from dual
  7  /
Table created.
SQL> select  case count(*)
  2            when 0 then 'NO'
  3            else 'YES'
  4          end result
  5    from  tbl t1,
  6          tbl t2
  7    where t2.cnt - t1.cnt > 1000
  8      and rownum = 1
  9  /
RES
YES
SQL> drop table tbl
  2  /
Table dropped.
SQL> create table tbl
  2    as
  3      select 42986 cnt,'A_TBL' table_nm from dual union all
  4      select 42980,'B_TBL' from dual union all
  5      select 42950,'C_TBL' from dual union all
  6      select 42970,'D_TBL' from dual
  7  /
Table created.
SQL> select  case count(*)
  2            when 0 then 'NO'
  3            else 'YES'
  4          end result
  5    from  tbl t1,
  6          tbl t2
  7    where t2.cnt - t1.cnt > 1000
  8      and rownum = 1
  9  /
RES
NO
SQL> SY.

Similar Messages

  • Speeding up the footage more than 1000% but with transitions

    Hey there,
    I am trying to speed up the footage of a view out of an airplane window in Premiere Pro CC. I basically want to have a view over the whole landscape, let's say in a height of 300m, and then speed this view gradually up until the airplane lands, and all this within around 3-5 seconds seconds.
    The first problem I have is that I seem to not be able to speed my footage up to more than 1000%. If I wanted to have a time lapse between being up in the air and landing on the runway within like 5 seconds that is definitely not enough.
    The second problem is that I don't want to start the timelapse sudden, but have a transition when changing the speed. Normally, I do that with these blue little handles to get a S-curve for my speed of a certain clip. When I tried googling it considering a higher speed than 1000% someone only suggested to export the speeded clip, import it again and then speed it up again. But then there is no gradually speed up possible, it only works for the same speed over the whole clip
    Summarizing these problems, I can't find a way to speed my footage up to more than 1000% without loosing the effect of a gradually S-speed-curve.
    Does anyone have an advice on how to solve this problem, especially focussing on my specific clip?
    Thank you and sorry for my english.
    Peter

    You should not have to render your captured material. If the capture settings match the sequence settings (conform this by checking item properties for both) then no rendering is necessary except for effects and filters.
    Offline editing (editing in low res and capturing in full res) is not a function available in FCE.

  • Trouble with the SQL smt to :list tables having more than 1000 rows

    Please I trying to list only tables having more than 1000 rows, but the sql stmt below doesn't work, can someone gives me a tips
    select table_name from user_tables where table_name in ( select table_name from user_tables where rownum > 1000 ) : The result is no rows!
    But I know that I have at lest 50 tables having more than 1000 rows
    Thanks a lot for the help

    If your tables are reasonably analyzed, then you can simply query:
    SELECT table_name,
           num_rows
      FROM user_tables
    WHERE num_rows >= 1000This will give you quite a reasonable estimate.
    Otherwise you have to go for dynamic sql or use the data dictionary to help you generate suitable scripts ....

  • I have more than 1000 contacts in my etisalat sim card, but when I import the contats its stop at 750 contacts, what is wrong? i read the phone can carry thousands of contacts..what shall i do?

    I have more than 1000 contacts in my etisalat sim card, but when I import the contats its stop at 750 contacts, what is wrong? i read the phone can carry thousands of contacts..what shall i do?

    Thanks, it seems that it doesn't like to play games, which is a bit of a bummer as i bought this specifically because it was capable of doing that.  To be fair, it is capable... I just need to get used to a sound like sitting by a washing machine on spin cycle...  Wish they would make people aware of this in the Apple Store, its very misleading and not at all desireable.

  • Update the authorization object value for more than 1000 role

    I need to remove one of the activity value (06) from authorization object S_SCD0.
    I do a search and found out that there are more than 1000 roles which having the activity value = 06 for authorization object S_SCD0.
    However, I don't think I can create a SCAT script to update all these 1000 roles and I believe its going to be a very tedious if I am going to manually change it one-by-one. Hence, I am wondering is there any standard program/function which I can use to automate the above changes for all these 1000 over roles.
    Kindly advise.
    Thanks

    Direct update the table is the easiest way, but should be discourage for the obvious reason.
    Should take a step back, take a long term view, when you need to update 1000 roles, maybe a role redesign might be needed. For example, if you can change the role model to derive role model, once update to the parent role will take care of all the child role.
    Thanks,
    Lye

  • How can i get more than 1000 items in Custom List Displaying Items?

    http://.....sites/_vti_bin/listdata.svc/AddressBook(List) allows 1000 items Only my AddressBook List, but i have more than 1000 items in my AddressBook list. I want to get items
    from AddressBook list and bind in another place using Autocomplete method like this.
    =======>>>>listurl=http://.....sites/_vti_bin/listdata.svc/AddressBook.
    and my coding in camel like below
    protected void btnpopulatedetails_Click(object sender, EventArgs e)
    SPSite objSite = SPContext.Current.Site;
    SPWeb objWeb = objSite.OpenWeb();
    objWeb.AllowUnsafeUpdates = true;
    SPList list = objWeb.Lists["Address Book"];
    SPQuery query = new SPQuery();
    query.QueryThrottleMode = SPQueryThrottleOption.Override;
    query.Query = "<Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + txtcustomer.Value + "</Value></Eq></Where>";
    query.RowLimit = 500;
    SPListItemCollection items = list.GetItems(query);
    function fnCustomerSearchBind() {
    if ($("input[id$='txtcustomer']").length != 0) {
    var collcustomer = searchCustomers('', urlTo, fieldto);
    $("input[id$='txtcustomer']").autocomplete({
    source: collcustomer,
    //maxLength:10,
    select: function (event, ui) {
    //debugger;
    event.preventDefault();
    $("input[id$='txtcustomer']").val(ui.item.value);
    $("input[id$='btnpopulatedetails']").click();
    return false;
    minLength: 0,
    function searchCustomers(value, listurl, fieldto) {
    var collcus = new Array();
    var custresults;
    var url =listurl + "?$filter=startswith('" + fieldto + "','" + value + "')";
    //debugger;
    $.ajax({
    cache: true,
    type: "GET",
    async:false,
    dataType: "json",
    url: url,
    success: function (data) {
    custresults = data.d.results;
    //alert(listurl);
    // alert(data.d.results);
    for (var x = 0; x < custresults.length; x++) {
    //alert(custresults[x]['To']);
    collcustList.push(custresults[x]['To']);
    //debugger;
    //debugger;
    return collcustList;
    In my research listurl=http://.....sites/_vti_bin/listdata.svc/AddressBook has 1000 items in 1st Page by default, So how to change 1st Page by default to All Pages through
    code. I think you understand my environment by look above coding, if you don't I am using office 365 sandbox solution. One more thing i know through my research Pages can be change by using Ado.Net Data Service, i tried this one but this one support windows
    server 2008 r2 only but i am using Windows Server 2012 r2. Please help me if you know the answer.

    Hi,
    Here is a blog would be helpful:
    ADO.NET Data Services returns 1000 items
    https://gilleslauwers.wordpress.com/2010/12/08/ado-net-data-services-returns-1000-items/
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Create table more than 1000 colum

    Hello
    I have 1500+ column in my select query. how to create table like my query is
    create table xyz nologging as
    select a1,a2,a3,a4,a5,b1,b2,b3,b4,b5,................a1500
    from abcd a,bcde b
    where a.a1=b.b1
    In oracle 10g I can create only 1000 column in a table.
    Please suggest

    799301 wrote:
    My all columns are formulated with different different tables and want to create one intermediate table
    below query is just example
    select count(unique((case when sysdate >45 then video=Y and audio=N then 1 else 0 end))) vd_45,
    count(unique((case when sysdate >105 then video=Y and audio=N then 1 else 0 end))) vd_105,
    count(unique((case when sysdate >195 then video=Y and audio=N then 1 else 0 end))) vd_195,
    count(unique((case when sysdate >380 then video=Y and audio=N then 1 else 0 end))) vd_380,
    count(unique((case when sysdate >45 then video=N and audio=Y then 1 else 0 end))) ad_45,
    count(unique((case when sysdate >105 then video=N and audio=Y then 1 else 0 end))) ad_105,
    count(unique((case when sysdate >195 then video=N and audio=Y then 1 else 0 end))) ad_195,
    count(unique((case when sysdate >380 then video=N and audio=Y then 1 else 0 end))) ad_380
    from abcd a,bcde b
    where a.a1=b.b1;
    please suggest how create more than 1000 table columnBy creating a proper relation between the "formulated function" and stored value.
    Simplistically put:
    Do you model invoices as entities INVOICES_2010, INVOICES_2011 and so on?
    Or do you model it as INVOICES that has a year (date) attribute?
    It does not make sense to put attribute data into the name of entity. Nor does it make sense to put relationship data into the name of an attribute and create a 1000+ attributes as a result.

  • List with more than 1000 elements

    I'm trying to use this query:
    select *
    from street
    where street_cod in ('street_code_list')
    It working well when the 'street_code_list' has less than 1000 codes but it fails when it have more, with a message that says that a list can't have more than 1000 elements. How can I fix this problem? Can I use any other kind of object to store my list?
    I'm querying the database in ColdFusion using ODBC.
    Thank you in advance,
    Rui

    Another thing to consider doing is simply creating a "list table" which would contain your list elements and allow you to do a
    SELECT X
    FROM Y
    WHERE X IN (SELECT X
    FROM Z)
    type query.
    I don't know where you are getting your list from, but if it is persistant (i.e, doesn't change with every program run) this is certainly a viable option (and may be usable even if the list does change every run).
    If this is being executed in PL/SQL (or some other procedural language) you could also just loop through your list: execute the query with the first 1000 list elements and do your processing, then the next, and so on. Of course, to some extent this depends on your processing, but if you need the entire result set before you can process it, then you could store the individual result sets in a PL/SQL table or an array (if you are using Pro*C or whatever) and then process when the PL/SQL table/array was fully populated.

  • How to pass more than 1000 entries in 'IN' clause, Oracle 11g

    Hi All,
    I know this is a very common question in Oracle discussion forum. But, Im in different zone.
    I use C#, .NET and Oracle 11g. I have a situation where I will create a query statement using 'IN' clause in C# code based on my requirement and execute that statement from code itself with oracle connection object. I do not have any procedures. I must phrase my query statement and pass it on to OracleConnection object to execute it.
    My code looks like this....
    List<decimal> x_Ids = new List<decimal>();
    I will load my IDs into x_Ids here;
    string whereInClause = ........I will prepare a 'IN' clause (All IDs separated by ',')
    My query would looks like this....
    string query = select * from MYTABLE where X_ID in [ whereInClause with more than 1000 entries]
    oraConn.ExecuteQuery(query);
    I have a workaround with OR operator with 'IN' clause like below.
    X_ID in [ Ids till 1000 entries] OR X_ID in [Next 1000 entries] OR X_ID in [Next 1000 entries] ....so on.....
    It is working, but, I heard that this may slowdown the performance of the application. Is this really a performance hit to my application?
    Can you please suggest any other workaround to overcome this situation?

    >
    I have a workaround with OR operator with 'IN' clause like below.
    X_ID in [ Ids till 1000 entries] OR X_ID in [Next 1000 entries] OR X_ID in [Next 1000 entries] ....so on.....
    It is working, but, I heard that this may slowdown the performance of the application. Is this really a performance hit to my application?There should be no performance difference between a statement like
    select * from myTab
    where ID in (1,2,3,4,5)
    OR ID in (6,7,8,10,12) and
    select * from myTab
    where ID in (1,2,3,4,5,6,7,8,10,12) The execution plan should be identical.
    However those values might better be send as a single object (collection or table of numbers type).
    I think the ODP or OO4O connectivity allows to create and such oracle object types.
    Another way could be to think about how all the values are created? Did any user enter them manually? Certainly not. Then maybe you can apply the same logic to the SQL statement that created those values in your .Net application.
    something like
    select * from myTab
    where ID in (select t2.FK_ID from otherTab t2 where t2.Col1 = 100) This approach would probably beat all others performancewise. Since you avoid the overhead of constructing the in-lists.

  • IN operator with more than 1000 values

    Hi,
    For a given list of IDs (PKs), I need to fetch the corresponding rows.
    The problem is that I have more than 1000 values and as far as I know that IN operator is limited to 1000
    values.
    I thought about using UNION such that each Select contains up to 1000 IDs.
    example":
    select * from temp where id in(1....1000)
    union all
    select * from temp where id in(1001....2000)
    Is there a better way to do that?
    Thanks
    dyahav

    As others have presented technical solutions, i'll present you a logical one (seemingly logical anyways, but it will depend on your application).
    I have seen some applications where you get
    select * from some_table where ... <conditions>;That result set is returned to the front end and presented to the users who then pick a series of records and submit another request to the database which ends up being...
    --note, this could be a many table join, with lots more information that just the some_table, this is illustrative only
    select * from some_table where pk_value in (super_super_duper_list_based_on_last_result_set);If this mimics what you have in your application, i'd recommend just fixing it so the users can select a reasonable set of data, OR the entire set (in the last case you'd just send the <conditions> instead of a massive list of PK values).
    Again, highly speculative but i thought i'd mention it in the off chance it's useful to you.

  • Error while fetching more than 1000 mysql records

    I'm trying to fetch data from a MySQL database through PHP to a Flex application. When there are more than 1000 records in the resultset, the FaultEvent is returned. When I limit it to 1000 records, no problem at all. Any ideas? Code below:
    public function OldCustomerService(method:String=HTTPRequestMessage.POST_METHOD, resultFormat:String=RESULT_FORMAT_E4X, showBusyCursor:Boolean=true)
                super(null, null);
                this.requestTimeout = 0;
                this.method = method;
                this.resultFormat = resultFormat;
                this.showBusyCursor = showBusyCursor;
            public function getAllProspects():void {
                this.url = ALL_PROSPECTS_URL;
                this.addEventListener(ResultEvent.RESULT, getAllProspectSuccess);
                this.addEventListener(FaultEvent.FAULT, DAOUtil.communicationError);
                var oldCustomersToken:AsyncToken = this.send();

    It works with fewer records so it would be weird if it would be a php or mysql error. Seems to me Flex isn't waiting until everything is in. To give you a better idea of what's happening, I'll post the PHP code:
    <?php
    * Created on 19-mrt-10
    * To change the template for this generated file go to
    * Window - Preferences - PHPeclipse - PHP - Code Templates
         include '../../application/general/php/general.php';
         // connect to the database
         $mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD) or die(mysql_error());
        // select the database
        mysql_select_db( DATABASE_NAME );
        // query the database to retrieve all customers.
        $query = "SELECT * FROM stores";
        $result = mysql_query($query);
        //start outputting the XML
        $output = "<result>";
        if($result) {
            $output .= "<success>yes</success>";
            $output .= "<stores>";
            // create a store tag for each retrieved store
            while($customer = mysql_fetch_object($result)) {
                $output .= "<store>";
                $output .= "<naam>$customer->naam</naam>";
                $output .= "<adres>$customer->adres</adres>";
                $output .= "<postc>$customer->postc</postc>";
                $output .= "<wpl>$customer->wpl</wpl>";
                $output .= "<land>$customer->land</land>";
                $output .= "<telprive>$customer->telprive</telprive>";
                $output .= "<telbureau>$customer->telbureau</telbureau>";
                $output .= "</store>";
            $output .= "</stores>";
        } else {
            $output .= "<success>no</success>";
            $output .= "<error>\n";
            $output .= "Reason: " . mysql_error() . "\n";
            $output .= "Query: " . $query ."\n";
            $output .= "</error>";
        $output .= "</result>";
        print ($output);
        mysql_close();
    ?>
    When the error occurs, I get a <success>yes</success> and yet again the Fault error is thrown. Again, with fewer records, no problem.

  • Can columns be more than 1000 in a select query (oracle 11 g)

    I am getting this error: "ORA-01792: maximum number of columns in a table or view is 1000"
    I have a dynamic query where number of column can increase according to the user input.
    They can expect more than 1000 columns. Is it possible to fetch more than 1000 rows in a query?
    I appreciate all your help.
    Edited by: user10232912 on Apr 26, 2012 2:07 AM

    >
    They can expect more than 1000 columns.
    Then they are idiots. IMO.
    Open challenge. Show me an entity with a 1000 attributes and I will show you a flawed data
    model and a total lack of grasping fundamentals of implementing that into a relation database product like Oracle.I second that - as someone who once had to ETL a system which had a table with 35.000 fields - that's 35K.
    It was a system which made extensive use of arrays - and arrays of arrays of arrays...
    Paul...

  • Any way to get more than 1000 characters in notes?

    i was just wondering if there was any way to get more than 1000 characters in the notes section of the ipod. i have outlines for school and they are a lot longer than 1000 characters... i didnt know if there is a setting on itunes or the ipod or a hack or mod to make it more than 1000 character limit. thanks for the help

    No.
    You can use the iPod in Disk mode and copy the outlines in their native format (Word?) and put them on your own computer.

  • I am running a strain gage test and can't get more than 1000 samples

    A formor employee left a strain gage VI that I am attempting to reuse but no matter what I do I can,t get more than 1000 samples before needing to restart the loop. In the task timing (of NI-DAQmx) I have set the acquisition mode to N Samples and the clock settings to read 65000 samples at 25 Hz. There is a DAQmx timing(sample clock) VI that resets to finite samples and 1000 per channel when I close it but I have reset it to 65500 continious samples and left it open to no avail. There is a rate input to this sample clock on the front window that I have tried setting to several different rates to no avail. The Vi will run about 15 seconds, collect 1000 samples and then ask to verify the file location to save the data to. Upon verifying the file location the VI will run another 15 sec. loop before stopping for verification again.
    If the loop is stopped rather thanhaving the file verified an error is listed:
    Error-200278 occurred at DAQmx Read (Analog 1d WFm NChan NSamp).vi:1
    The given possible reason given is: attempted to read a sample beyond the final sample acquired.
    When I stop attempting to run the VI the block diagram opens with a dark block around file creation block. I need this VI to run for 10 min. collecting samples at about 25/sec. Can someone help me figure out what I am doing wrong?
    I have made screen shots of the VI and the error code to assist finding the incorrect programing.
    Thank you for your help.
    Jim Steinmeyer
    Jim Steinmeyer
    Design Engineer
    Reinke Mfg.
    PO 566
    Deshler NE 68340
    [email protected]
    Attachments:
    strain test error.doc ‏493 KB

    Thank you,
    I was just thinking about being able to increse the size of the doc.  for better visability. I have tried working with the rate input for the DaQmx for the sample clock and it does change the frequency of sampling, but I still get just the 1000 samples. I have included Jpegs this time. I have tried to exppand the two DAQ assistants that arn't expanded but am unable to, I also am unable to find a "propertys" command to open them up and see what exactly they do. The nested while loop for output also seems strange to me. Maybe I would be better to attempt a new program but being new to the language I thought using an existing program might be best.
    Jim
    Jim Steinmeyer
    Design Engineer
    Reinke Mfg.
    PO 566
    Deshler NE 68340
    [email protected]
    Attachments:
    block diagram.JPG ‏134 KB
    DAQmx.JPG ‏129 KB

  • Exchange rate difference account is showing more than invoice or advance am

    Hi,
    Exchange rate difference account is showing more than invoice or advance amount  (USD V/S INR)
    1)  we have done down payment of customer.  (USD V/S INR  RS. 40/- PER DOLLAR)
    2)  Invoice posting also done  (RS. 42/-)
    3)  At the time of Invoice against down payment clearing  (RS. 43/-)
         At the time of clearing exchange rate difference account is generated automatically (back ground calculated).
         But exchange rate differemce account is displaying amount is more value.  This value is more than invoice and advance value.
         But question is how this much of value is getting in exchange rate difference account.
         Please suggest possible ways to get that.
    Regards
    Srinivas Gundala

    Hello
    There is a SAP note 357758. Please refer the same and also contact SAP OSS.
    Rgds

Maybe you are looking for

  • Screen flicker on external monitor

    Has anyone had any experience with screen flicker on an external monitor?  I connected my laptop to an external monitor and I get consistent flicker on the whole screen.  If anyone can help, or could help pointing me to website etc. I'd appreciate it

  • Rollovers with Photoshop CS5?

    I created a web page in photoshop cs5 using layers and created rollovers. When I save  the file for web and export the file I do not get all my layers with the rollover states. Any helpful suggestions? Thanks, Madtown3

  • Only part of a song from a CD uploaded.

    A CD I own has a song and I can play all 4 minutes or so of the song on my CD player.  When I upload the CD to iTunes only the first 9 seconds of the song is saved.  Any suggestions as to how I can get the song uploaded properly?  I upload in AIFF fo

  • Too many javas?

    Hi, Lately I've been having some minor problems with websites. I was told that the problems are Java related. I checked in Add\Remove Programs and there's 4 listings: 1) J2SE Runtime Environment 5.0 update 2 ? 125MB 2) J2SE Runtime Environment 5.0 up

  • Is there a set of regular expression operators which can be applied to Thunderbird message bodies?

    I want to filter on text or format that may appear in message text. If Thunderbird could parse regular expressions with a normal set of commands and apply them to the message body, my filtering task would be immensely more efficient.