Unlike COUNTY and the difference in data between 2 sets of data

Hey guys,.
I have a question here, probably, it revolves around the UNION, INSERSECT and LESS and maybe something else I'm missing.

I'm two sets of questions, and I have 2 paintings.
select count(student_id) from adhoc_student_table1;
select count(student_id) from adhoc_student_table2;

select student_id from adhoc_student_table1 order by student_id;
select student_id from adhoc_student_table2 order by student_id;
These tables contain data and have been sorted by student_id. I want to find the difference in NUMBER between the first set of SELECT and I want to find a difference in the student ID in the second set to SELECT.

Any ideas? As always, any help is appreciated!

Hello

These tables do contain data and have been sorted by student_id. I want to find the difference in COUNT between the first set of SELECT and I want to find a difference in Student IDs in the second set of SELECT.

Hope this helps

select (select count(student_id) from adhoc_student_table1) -
   (select count(student_id) from adhoc_student_table2) from dual

---If you want the difference in first table not available in second table.

select student_id from adhoc_student_table1 order by student_id
minus
select student_id from adhoc_student_table2 order by student_id

-- or you wanted the difference from both table.
with tab1 as
(
   select student_id from
      adhoc_student_table1
)
tab2 as
(
    select student_id from
adhoc_student_table2
)
select * from (select student_id from tab1
                     union select student_id from tab2)
minus
select * from (select student_id from tab1
                    intersect select student_id from tab2)
)

If you could post the input samples and expected, maybe you can get a more valuable solution.

Concerning
Anurag Tibrewal.

Tags: Database

Similar Questions

  • determine the difference in phase between a reference signal and measure

    Hello

    I use a PXI-1000 b with two cards DAQ, PXI-6133 and I need to measure the difference in phase between a reference sinusoid, acquired on a map and an acquis of the sinusoid measured on the other card.  So far, my idea is simply to acquire samples of N of these two signas as waveform data, then compare.  My problem is that I see a way to extract the information from the relative phase.  How would I do that?  Is there a better way to achieve this end?

    Hey GlenS

    Check out this link. Use it a Subvi spend an entry as the data acquisition card entry and the other your reference wave. It should work.

    Good luck

    -laboratory

  • How to find the difference "within weeks" between two date values?

    Hi all

    Jdev version 11.1.1.7.1

    I used two < af:inputDate > & a < af:inputText > < af:panelFormLayout > components. My requirement is, I want to display the difference of weeks between these two day values in the inputText component when the user clicks the shape.

    Any suggestion would be appreciated.

    Kind regards


    Novel

    You can use this method to get the number of days between the day and date, and then divided by 7 to get the number of weeks

    public static long getDifferenceDaysBetweenTwoDates (d1, d2 oracle.jbo.domain.Date oracle.jbo.domain.Date)

    {

    If (d1! = null & d2! = null)

    {

    return (d1.getValue () .getTime () - d2.getValue () .getTime ()) / (24 * 60 * 60 * 1000);

    }

    return 0;

    }

    Check - http://sameh-nassar.blogspot.in/2014/10/dealing-with-dates-in-java.html

    Ashish

  • find the difference in days between two dates

    Hello world

    I'm trying to find out the difference in days between two dates and the execution of the query that I'm passing

    SELECT TO_char(sysdate, 'dd/mm/yyyy') - TO_char('15/11/2011', 'dd/mm/yyyy') DAYS FROM DUAL

    the error I get is

    ORA-01722: invalid number
    01722 00000 - "invalid number."
    * Cause:
    * Action:

    Could someone please help.

    Thanks in advance

    user10636796 wrote:
    Hello world

    Thanks a lot for all the replies. I am trying to apply it in a statement to my table like this

    SELECT trunc (sysdate) - TO_char (date_last_recommended, ' dd/mm/yyyy') DAYS OF recommendation;

    SELECT trunc (sysdate) - TRUNC (date_last_recommended) DAYS OF recommendation;

  • Calculate the difference in days between two Dates

    Hello

    I'm trying to understand how to calculate the difference in days between two dates using JavaScript in LiveCycle. (Minimum = JavaScript knowledge)

    Where 'Start_Date' and 'Current_Date' are the names of the two dates in the palette of the hierarchy. (the two Date/time field)

    * Current date is using the object > value > execution property > current Date/time

    I need a text or number field showing the difference in days. (Difference_in_Days)

    I noticed the following code is pretty standard among other responses:

    var

    Start_date = new Date (Start_Date);

    var

    Current_Date = new Date (Current_Date);

    var

    nAgeMilliseconds = Current_Date.getTime) - Start_date.getTime ();

    var

    nMilliSecondsPerYear = 365 * 24 * 60 * 60 * 1000 ;

    I know there is lack of code and code above are may not be not correct.

    Please notify.

    OK, that's because of the way that javascript and works of the calculate event.  The field will be filled with whatever the script resolves at the end of execution. Technically, your script does not have a value because the last thing you do is an assignment to a variable.  Change the last line as follows:

    Math.ABS ((firstDate.getTime)

    ((- secondDate.getTime (()) / (oneDay));

    (eliminate the variable assignment) and get rid of the app.alert.  Your script will "return" (have) regardless of the value of calculation from the East and which will be stored in the field.

  • Get the difference in days between 2 dates in Essbase 9.3.1

    How to calculate to get the difference in days between 2 dates in the format day of Essbase 9.3.1.la is 20090101 (yyyymmdd). If 2010907-20100917 = 10 days.
    Start and end dates may extend over several years.

    @DateDiff does not exist in the 9.3.1 I think. With this assumption...

    Could you use the CDF 'Functions of Date'? According to the docs (I've never used it):
    @JdaysOffset - returns the number of days between the firstDate and the secondDate.

    See samplecode.oracle.com for the CDF. Just search for CDF and you will find it on the second page (I think) of the FMCS.

    Or see this thread for another approach that I think the CDF under the covers: Re: Formate Date.

    Of course, you could spend to 11 for DateDiff. :)

    Kind regards

    Cameron Lackpour

  • Validate the difference in days between the dates in a table

    Greetings,

    I have a tabular form and date on each line. When the user saves the form, I want to sort the rows by chronological order of these dates, then go get the first and last date, calculate the difference between them and validate it.

    Does anyone know how to do?

    From now on, I came up with this:

    1. a PL/SQL Page process "before the calculations and Validations' which creates a collection and inserts lines in my tabular form (p_c004 being the date field):
    begin   
      if apex_collection.collection_exists('UPDATE_DATES') then
        apex_collection.delete_collection('UPDATE_DATES');
      end if;
    
      apex_collection.create_or_truncate_collection('UPDATE_DATES');
    
      for i in 1..apex_application.g_f04.count
      loop
          apex_collection.add_member(
              p_collection_name => 'UPDATE_DATES',
              p_c002            => htmldb_application.g_f02(i),
              p_c003            => htmldb_application.g_f03(i),
              p_c004            => htmldb_application.g_f04(i),
              p_c005            => htmldb_application.g_f05(i),
              p_c006            => htmldb_application.g_f06(i),
              p_c007            => htmldb_application.g_f07(i));
      end loop;
    end;
    and

    2. a "PL/SQL Error: Validation
    DECLARE
      l_count NUMBER;
    BEGIN
      apex_collection.sort_members('UPDATE_DATES', 4);
      l_count := apex_collection.collection_member_count('UPDATE_DATES');
    
      SELECT
      to_date(c004(l_count),'DD/MM/YYYY') - to_date(c004(1),'DD/MM/YYYY') Difference 
    
      FROM 
      apex_collections 
    
      WHERE 
      collection_name = 'UPDATE_DATES'
      and to_date(c004(l_count),'DD/MM/YYYY') - to_date(c004(1),'DD/MM/YYYY') < 30;
    
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        raise_application_error(-20101, 'Error');
    END;
    In my understanding, the validation must sort the collection in chronological order of the dates entered, calculate the difference in days between the nearest and farthest date and return it if it's less than 30 years (the difference in days allowed). If it's more than 30 years, the SELECT statement does not return anything and my block of exceptions raises a custom error that will trigger the validation "process of refusal."

    But when I try this, it tells me c004 does not exist and if I drop the parentheses, it works, but of course, it does not give the desired result.

    Any ideas?

    Best regards
    Mathieu

    Assuming that your domain is c004 then I don't see the need for the sorting of the collection.

    You can write a simple SQL select that sent you the desired result.

    Maybe something like this not tested

    SELECT
      max(to_date(c004,'DD/MM/YYYY')) - min(to_date(c004,'DD/MM/YYYY') ) Difference
      FROM apex_collections
      WHERE collection_name = 'UPDATE_DATES';
    

    The test if the result is > 30 days. If that's what you want to know.

  • How to find the difference in date in years, months and days

    Hello
    I need to find the difference between 2 dates in the following way "years months days". "
    Please can help me, how can I achieve this.

    for example, in the scott schema emp table, I need to find the difference in date between sysdate and hiredate for an employee in the following way.

    12 years 7 months 4 days.

    Hello

    Please, see this post to AskTom [difference between 2 dates | http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:96012348060]. There is good information in this forum, for example you can also see this thread [calculation of years, months & days | http://forums.oracle.com/forums/thread.jspa?messageID=3115216�]

    Kind regards

    Published by: Walter Fernández on November 30, 2008 08:58 - adding another link

  • What is the difference (if any) between iPhoto and iPhoto library? I managed to delete my pictures in freeing up space, but have a backup available. Do I have to download these two files in the pictures folder is one duplicate of the other?

    What is the difference (if any) between iPhoto and iPhoto library? I managed to delete my pictures in freeing up space, but have a backup available. I need to restore these two files in the folder images or one is one duplicate of the other?

    I use a MacBook Air 2013 model with a backup on a WD MyBook Duo disc for storage wireless as the Apple Time Machine.

    The Photos and the iPhoto library are totally separated - neither one is connected to the other somehow--you want to restore the library you need

    LN

  • How to measure the difference in time between the passage by zero of a sine wave and the rise time of a pulse on a same graphic?

    I have a sine wave of 50 Hz and a pulse of the signal on the same chart. The difference in phase between the two is between 0-90 degrees.

    Now I need to calculate the time difference between (when the sinusoidal wave passes through zero volts) and (when the pulse increases). The frequency will remain about even for the two signals.

    The request is for a three-phase generator. In simple terms, when the difference in time between the passage to zero of the sine wave and pulse increases increases, it means that the load on the generator has increased.

    I am a novice user of LabView (version 9, 2009), maybe it's a very simple problem but I was pulling on my hair for the past few days and couldn't understand anything. Any help would be greatly appreciated. I use DAQ USB-6008 to measure these tensions and the impulse of the generator and a sensor

    I have attached a jpg file (a graphic that I just did with excel to explain). The time 't' is what I'm trying to measure

    See you soon

    Zdzislaw

    Awais.h,

    For problems of this kind I recommend start writing the granular steps you would take to manually fix this problem.  You can't say LabVIEW (or any programming language) If you can't succinctly describe the solution to your problem.

    The I want to address this problem is to:

    1. find all the zero crossing points and edges on the rise
    2. for every rising edge find the difference between the timestamp and previous passage by zero

    Here is an implementation of this algorithm LabVIEW:

  • How to create a file name variable with the County and the date?

    Objective: Create a file name variable with the County and the date

    Error: get a lot of error. Do you know how to change my code?

    Question: how to create a file name variable with the County and the date?

    Mini code:

    std::string * rawfilepath;
    std::string * rawfilename;

    rawfilepath = "./shared/documents/";
    RawFileName = rawfilepath + 'rawlog -' + 0 + '-.txt ';
    QFile file (rawfilename);
    If (file.exists ()) {}
    rawfilenamecount ++;
    RawFileName = "./shared/documents/rawlog-" + rawfilenamecount + "-.txt ';
    }

    Thank you for your attention,

    Thank tzander reminding me the idea. Method of cascades is not good for me because all of the kernel code is written by Native. If I change the channel to QString, I need to change a lot of codes.

    Solution is below.

    While (access (rawfilename, F_OK)! = - 1) {}
    rawfilenamecount ++;
    sprintf (format, RawFileName, rawfilenamecount);
    fprintf (stderr, "file exists");
    }

    Rawlog = fopen (rawfilename, "w"); Save the file in a specific path.
    fprintf (rawlog, "System Time (ms)" "");

  • What is the difference in features between the domain of Adobe Acrobat Standard and Pro controller?

    What is the difference in features between the domain of Adobe Acrobat Standard and Pro controller?

    See: http://www.adobe.com/products/acrobat/product-comparison.html

    Monday, June 1, 2015-16:00, jeanm18631066, [email protected]>

  • Average of the difference in date in minutes

    Hi friends

    I have a table called attendance with 3 columns
    eid  number
    in   date
    out  date 
    two columns (in, out) of date are stored with date and time. The table will have multiple entries
    Is it possible that I can calculate the average of the difference in minutes between in and out of all the records
    using a single query or don't we have the right to use the loop.
    For Example
    
    eid         in                      out             difference in minutes
    1    01-01-2012 09:00:00   01-01-2012 10:00:00              60
    2    01-01-2012 09:05:00   01-01-2012 10:10:00              65  
    3    01-01-2012 09:10:00   01-01-2012 10:20:00              80  
    The result should be the average difference of minutes IE (60 + 65 + 80) / 3 which would be 68.33

    Thanks in advance
    Concerning
    Park

    Hello

    Use

    select avg((out - in) * 24 * 60)
    from 
    
  • I have a G4 and the transfer of data to an I mac?

    I have a G4 and the transfer of data to an I mac? There is no port Firewire on the Imac A1418

    Use a FireWire 800 adapter Thunderbolt and if necessary, an adapter FireWire 400 and 800. If you wish, you can use a network or external drive instead.

    (142220)

  • How to make the difference in percentage between two matrices?

    Hello everyone, I just want to ask how to make the difference in percentage between two binary matrices. This is to compare two images converted to matrices in LabView. Thank you.

    Well, in the current image interesting pixels are zero in the reference image. Here is a small example that would take all the zero 100% pixel, then look at the pixels of same in the other image to see how are always 0.

    Modify if needed.

Maybe you are looking for

  • The model that is hidden on the desktop computer. Cannot remove

    I've updated my Mac Mini this morning, and somehow I'm done with a model hidden on my home screen. I tried to restart and it won't go away. I have nothing open right now so it is not a program. Can someone tell me how to get rid of it. The screenshot

  • Help with authentication error [R0107005]

    OS X 10.10.1 and Thunderbird 31.4.0. I have two accounts with my ISP (Time Warner). Both use the same password. Suddenly, I am unable to send one of these accounts (works well for months). There has been no change before this problem. After that the

  • Helix keyboard problem

    On the propeller Thinkpad how to use keys F and let the button end to be thin and not Insert? The keyboard dock of the propeller doesn't have a button separate insert (but Fn + end) Now, I need the F keys be default... but I don't want to put an end

  • Update failed to install KB2481109

    I can not install KB2481109. I tried manually, automatically and through Fix Me. I get the error 0X8007F0F4 code.

  • Vista-stop my password account administer expired

    How can I stop my password account administration to expire. I'm using vista Home premium.