Get the last disc based on the date

Version of database

Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production
PL/SQL Release 9.2.0.8.0 - Production
CORE Production 9.2.0.8.0
AMT for HP - UX: 9.2.0.8.0 - Production Version
NLSRTL Version 9.2.0.8.0 - Production

data and model table


CREATE TABLE EXAMPLE
(
UNIT_ID1 VARCHAR2 (15 BYTE) NOT NULL,
COLL_DATE1 DAY,
ATTRIB_CODE1 VARCHAR2 (4 BYTE) NOT NULL,
UNIT_ID2 VARCHAR2 (15 BYTE),
COLL_DATE2 DAY,
ATTRIB_CODE2 VARCHAR2 (4 BYTE),
DATE OF AUDIT_INSERT_DATS NOT NULL
)





Insert into SAMPLE
(UNIT_ID1, COLL_DATE1, ATTRIB_CODE1, UNIT_ID2, COLL_DATE2,
ATTRIB_CODE2, AUDIT_INSERT_DATS)
Values
('W039712008646', TO_DATE (OCTOBER 8, 2012 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'DP', 'W039712008646', TO_DATE (OCTOBER 8, 2012 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'),)
'PP', TO_DATE (OCTOBER 9, 2012 11:10:56 "," MM/DD/YYYY HH24:MI:SS'));)
Insert into SAMPLE
(UNIT_ID1, COLL_DATE1, ATTRIB_CODE1, UNIT_ID2, COLL_DATE2,
ATTRIB_CODE2, AUDIT_INSERT_DATS)
Values
('W039712008646', TO_DATE (OCTOBER 8, 2012 00:00:00 "," MM/DD/YYYY HH24:MI:SS'), 'DP', NULL, NULL,)
'DP', TO_DATE (OCTOBER 9, 2012 11:11:02 "," MM/DD/YYYY HH24:MI:SS'));)
Insert into SAMPLE
(UNIT_ID1, COLL_DATE1, ATTRIB_CODE1, UNIT_ID2, COLL_DATE2,
ATTRIB_CODE2, AUDIT_INSERT_DATS)
Values
('W039712008647', TO_DATE (OCTOBER 8, 2012 00:00:00 "," MM/DD/YYYY HH24:MI:SS'), 'DP', NULL, NULL,)
'DP', TO_DATE (OCTOBER 9, 2012 11:15:18 ',' DD/MM/YYYY HH24:MI:SS'));)
Insert into SAMPLE
(UNIT_ID1, COLL_DATE1, ATTRIB_CODE1, UNIT_ID2, COLL_DATE2,
ATTRIB_CODE2, AUDIT_INSERT_DATS)
Values
('W039712008649', TO_DATE (OCTOBER 8, 2012 00:00:00 "," MM/DD/YYYY HH24:MI:SS'), 'TP', NULL, NULL,)
'TP', TO_DATE (OCTOBER 9, 2012 11:15:39 ',' DD/MM/YYYY HH24:MI:SS'));)
Insert into SAMPLE
(UNIT_ID1, COLL_DATE1, ATTRIB_CODE1, UNIT_ID2, COLL_DATE2,
ATTRIB_CODE2, AUDIT_INSERT_DATS)
Values
('W039712008650', TO_DATE (OCTOBER 8, 2012 00:00:00 "," MM/DD/YYYY HH24:MI:SS'), 'RD', NULL, NULL,)
'RD', TO_DATE (OCTOBER 9, 2012 11:16:10 ',' DD/MM/YYYY HH24:MI:SS'));)
Insert into SAMPLE
(UNIT_ID1, COLL_DATE1, ATTRIB_CODE1, UNIT_ID2, COLL_DATE2,
ATTRIB_CODE2, AUDIT_INSERT_DATS)
Values
('W039712008653', TO_DATE (OCTOBER 8, 2012 00:00:00 ',' DD/MM/YYYY HH24:MI:SS'), 'CX', NULL, NULL,)
'CX', TO_DATE (OCTOBER 9, 2012 11:17:23 ',' DD/MM/YYYY HH24:MI:SS'));)
COMMIT;

-----------------------

unit_id W039712008646 has two records. I need a query to get the last disk based on audit_insert_dats. Any help is appreciated.
I tried to use max (audit_insert_dats) but not able to get a record

user_anumoses wrote:
unit_id W039712008646 has two records. I need a query to get the last disk based on audit_insert_dats.

You can use the ROW_NUMBER() analytic function

SQL> select *
  2  from
  3   (select a.*,
  4     row_number() over(partition by UNIT_ID1 order by AUDIT_INSERT_DATS desc) rn
  5    from sample a)
  6  where rn = 1;

UNIT_ID1        COLL_DATE ATTR UNIT_ID2        COLL_DATE ATTR AUDIT_INS         RN
--------------- --------- ---- --------------- --------- ---- --------- ----------
W039712008646   08-OCT-12 DP                             DP   09-OCT-12          1
W039712008647   08-OCT-12 DP                             DP   09-OCT-12          1
W039712008649   08-OCT-12 TP                             TP   09-OCT-12          1
W039712008650   08-OCT-12 RD                             RD   09-OCT-12          1
W039712008653   08-OCT-12 CX                             CX   09-OCT-12          1

Tags: Database

Similar Questions

  • How can I get the data view to display the same amount of time I save?

    I use the Sound and Vibration Measurement Suite.  In the data view, I display a graph of time, the power spectrum, the Color Map and the waterfall.  I am also showing strength in numbers group for several bands and doing cutting-edge research.  I record 100 ms of the transient wave.  In the data view, why the temporal plots show several seconds of data?  What determines how much time will appear in the data view?  More important, the power spectrum reflects the power for the entire of several seconds of data displayed?  Same question for power in the values of band and cutting-edge research.  I want to just this data displayed for 100 ms of the wave that I record.  So, how can I get the data displayed (waveforms) and power numbers come only 100 ms of the recorded wave?

    Finally, what is the best way to make account concisely the recorded data?  By slide numbers on the Documentation tab is not concise, because it comes with graphics, etc..  I tried save as ASCII/LVM, but I get a bunch of stuff intermiated I don't care.  Help?

    Hi TimRsandiego,

    SignalExpress is programmed to display graphs with default scales based on the type of action, it's reading. These scales and settings can be changed by right-clicking on the graph, and then select Properties.

    If you are interested to learn more about how to use SignalExpress, I would recommend checking out some demonstrations/tutorials on NI.com. You can find some of these demos at the following location:

    Let me know if you have any other questions.

    Kind regards

  • How to get the date of Sunday of the week

    Hello
    I have a column date 'start_date', I need to create a report for all the weeks from Sunday, for example:

    I need to get the dates of the week in the form:

    mm/dd/aa-23/01/11, 01/16/11, 09/01/11 and so on...

    Help, please

    Thank you...

    Hello

    To find the last Sunday before or equal to start_date:

    SELECT     TRUNC ( start_date + 1
               , 'IW'
               ) - 1          AS week_start_date
    ...
    

    You can also use an expression like that in a GROUP BY clause.

    It's not you NLS parameters. Always ISO weeks start on Monday. Your week begins 1 day earlier, that is why the above expression is the + 1 and -1.
    (According to the parameters of the NLS)

    SELECT     TRUNC ( start_date
               , 'D'
               )          AS week_start_date
    ...
    

    could do the same thing, but I still have rocommend with "IW"; a few extra touches is not big thing to pay for a guarantee that it will still work.)

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data.

  • Can someone show me how to get the data of this vi in four columns in a spreadsheet file.

    I'm trying to get the data into four columns on a worksheet. The data consists of two channels and two measures, a maximum voltage and a voltage after x seconds. I enclose the code. Any help would be great. Thank you.


  • Cannot get the date system. My input format is %d %m %Y and the output is also a format "YYYYMMDD"?

    Hi all

    I'm using Labview 8.5.

    I'm trying to get the date system.

    I use the Format Date/time string in a "%Y %m %d' format.

    The PROBLEM is the Format Date/time string return "YYYYMMDD" only.

    Please see my attachment to see.

    Please help me with this, whenever I encounter this problem it force to reinstall labview program.

    Best thanks!


  • How to get the Date, month, year of the DateTimePicker

    Hi, I am using the DateTimePicker.

    There are several question about this command:

    1. how to get the Date, month and year?

    -With the help of myDateTime.value, I get this string ' Wed May 08 14:45 ICT 2013 '-> I have to manually analyze this? Because I need in format yyyy/mm/dd. Or can set the format of dateTimePicker.value?

    2 format on dateTimePicker self (on the user interface) is d/m/YY, I can't change to another format?

    Thank you

    dateTimePicker.value return a QDateTime not a string.

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__datetimepicker.html#property-value

    See more:

    https://developer.BlackBerry.com/Cascades/reference/QDateTime.html#date

    https://developer.BlackBerry.com/Cascades/reference/QDate.html

    You can get

    day = dateTimePicker.value.date().day()
    month = dateTimePicker.value.date().month()
    year= dateTimePicker.value.date().year()
    dateYYYYMMDD = dateTimePicker.value.date().toString(Qt::ISODate)
    dateYYYYMMDD2 = dateTimePicker.value.date().toString("YYYY/MM/DD")
    dateYYYYMMDD3 = dateTimePicker.value.toString("YYYY/MM/DD")
    
  • Try to get the data of

    Help, please:

    I am trying to get the data from the internet in the Simulator. The browser wirks fine and I am able to navigate... but I'm nt get any :-(

    Here is my code:

    String url =

    "http://www * & format = json;

    C = HttpConnection

    null;

    InputStream is =

    null;

    int rc;

    try {

    c = (HttpConnection) Connector.open (url);

    Get the response code is open the connection,

    Send the request and read HTTP response headers.

    The headers are stored until asked.

    RC = c.getResponseCode ();

    if (rc! = HttpConnection.HTTP_OK) {

    throw new IOException ("HTTP response code:" + rc);

    }

    is = c.openInputStream ();

    Get the ContentType

    The string of type = c.getType ();

    The length and process data

    int len = (int) c.getLength ();

    if (len > 0) {

    int actual = 0;

    int BytesRead = 0;

    byte data = newbyte[len];

    while ((bytesread! = len) & (real! = - 1)) {

    real = is.read (data, bytesread, len - bytesread);

    bytesRead += real;

    }

    }

    else {

    int ch;

    while ((ch = is.read (())! = - 1). {

    }

    }

    }

    catch (E ClassCastException) {

    throw new IllegalArgumentException ("not a HTTP URL");

    }

    finally {

    if (is! = null)

    is. Close();

    if (c! = null)

    c.Close ();

    }

    Are you runing the MDS Simulator? It must be upon the connection form the Simulator, unless you specifically request a direct connection by adding «;» deviceside = true' to your URL.

  • I lost the password I gave to a drive using Bitlocker in Windows 7, how can I return it or I can get the data in the back of the player?

    Hello

    I lost the password I gave to a drive using Bitlocker in Windows 7, how can I return it or I can get the data in the back of the player? Data are very important because by my studies are concerned. Help, please. Thank you!

    Hello

    I lost the password I gave to a drive using Bitlocker in Windows 7, how can I return it or I can get the data in the back of the player? Data are very important because by my studies are concerned. Help, please. Thank you!
    People like you that encryption data with bitlocker do it because they want their data accessible only by those who have the certificate. The sad news for you is that you have made a good choice with BitLocker: unless you have the certificate, your data remains inaccessible. There is no backdoor. If he had then BitLocker would be useless.
  • How can I get the date and time function to appear as a tile

    How can I get the date and time function to appear as a tile

    How can I get the date and time function to appear as a tile

    WIN8 are delivered with this tile/app.  The only way to display the time is to launch the charm bar (Win - key + C) or mouse over to the right up/down.  That said go to the Windows store... There are several free applications that display the time / date as a live tile.  Good luck.

  • < dateformat: create, get the date in en_GB, es_ES instance

    Hello

    I don't know if it's a bug or normal behavior:

    I get the date in en_GB, but I ask the date to es_ES, the snippet of code below:

    < ics:if condition =' < % = ics. GetList ("FechaBlog")! = null & & ics. GetList("FechaBlog").hasData () % > ' >

    < ics:then >

    < ics:listget listname =' < % = "FechaBlog" > "fieldname = 'value' output ="Cash out"/ >"

    < local: create varname = "currLocale" nomlocale = "es_ES" / >

    < dateformat: create name = datestyle 'PostDateFormat' = 'average' timezoneid = "Europe/Madrid" locale = "currLocale" / >

    < name dateformat:getdate = "PostDateFormat" value = "< % = ics." GetVar ("cash") % > ' valuetype = "jdbcdate' varname ="FormattedPostDate"/ >

    < / ics:then >

    < / ics:if >

    22-may-2015

    I expect to get: 22 -mayo- 2015; But if change the 'average' datestyle to "long", I am getting:


    2015 22 Mayo


    as expected, in es_ES.

    This is the normal behavior? WCS 11.1.1.8

    Kind regards

    Hello Jorgitoito,

    This is how Java has shaped the date in Spanish. It is not specific to the WebCenter Sites.

    You can give it a try with this simple Java code:

    java.util.Locale locale = new java.util.Locale("es", "ES");
     java.text.DateFormat mediumFormat   = java.text.DateFormat.getDateInstance(java.text.DateFormat.MEDIUM, locale);
    System.out.println(mediumFormat.format(new java.util.Date()));
    java.text.DateFormat longFormat   = java.text.DateFormat.getDateInstance(java.text.DateFormat.LONG, locale);
    System.out.println(longFormat.format(new java.util.Date()));
    

    The results I got:

    27-May-2015

    2015 27 Mayo

    I suspect that 27-May-2015 here is not in English; It is simply the first three letters of mayo.

    Kind regards

    Stephan.

  • Is there a way to get the data for submission of form of eloqua using the REST API?

    I was wondering if there is a way to get the data for submission of form of eloqua using the REST API?

    Thank you

    On the page that egan related, there is a 'RawData' field for FormSubmit activities. In this area, the raw sending the form query string is returned.

    Whatever it is, you can get this info from the activities of the API block, or the endpoints data Rest API.

  • Compare and get the data in the tables (see post for details)

    I have two tables TableA and TableB. I struggle to write a query to get the dates of TableB (instead of TableA dates) where TableA dates don't coincide with the tableB (beginning and end).

    Example 1: For account A1234,.

    TableA got 2 rows 1/31/2014-3/3/2014 (which corresponds to TableB row), but TableA got another rank 31/01/2014 - 31/01/2014 that corresponds with the date of TableB Begin. In this case, I'm looking for output as below,

    Use TableB start and end date and combine number two rows from TableA for this account

    ACCOUNTTableB_BEGINTableB_ENDAMOUNT
    A123431/01/201403/03/2014100.0000000000

    Example 2: For the B7777 account.

    TableA end date aligns with the end dates of TableB for this account, in this case I want out put as,.

    Use TableB start and end date and get the amount of TableA

    ACCOUNTTableB_BEGINTableB_ENDAMOUNT
    B777705/04/201306/05/2013200.0000000000

    Example 3: On behalf of D5555,.

    Even a TableA line corresponds with TableA, there are two other rows in TableA matching start date with TableA and correspondence with the end date with TableA, in this case, that I put as,.

    Use TableB start and end date and combine number three rows from TableA for this account.

    ACCOUNTTableB_BEGINTableB_ENDAMOUNT
    D555508/08/201410/09/20141100.0000000000

    Example 4: To account E6666.

    Table corresponds to a row with TableB and no additional lines in TableA, just display the data in A table

    Tables and data:

    create table TableA
    (
      Account varchar2(10) not null,
      Begin   date not null,
      End     date not null,
      Amount  number(19,10) not null
    )
    ;
    
    
    create table TableB
    (
      Account varchar2(10) not null,
      Begin   date not null,
      End     date not null,
      Amount  number(19,10) not null
    )
    ;
    
    
    TableA Data:
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('31-01-2014', 'dd-mm-yyyy'), 0.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('03-03-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('B7777', to_date('18-04-2013', 'dd-mm-yyyy'), to_date('06-05-2013', 'dd-mm-yyyy'), 120.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('C6666', to_date('25-06-2014', 'dd-mm-yyyy'), to_date('08-07-2014', 'dd-mm-yyyy'), 10.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('16-08-2014', 'dd-mm-yyyy'), 1000.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 0.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('D5555', to_date('16-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('E6666', to_date('01-01-2014', 'dd-mm-yyyy'), to_date('01-02-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    TableB Data:
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('03-03-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('B7777', to_date('05-04-2013', 'dd-mm-yyyy'), to_date('06-05-2013', 'dd-mm-yyyy'), 200.0000000000);
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('C6666', to_date('06-06-2014', 'dd-mm-yyyy'), to_date('08-07-2014', 'dd-mm-yyyy'), 10.0000000000);
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 1100.0000000000);
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('E6666', to_date('01-01-2014', 'dd-mm-yyyy'), to_date('01-02-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    
    
    SELECT A.ACCOUNT,
           A.BEGIN,
           A.END,
           A.AMOUNT,
           B.ACCOUNT,
           B.BEGIN,
           B.END,
           B.AMOUNT
      FROM TABLEA A
      LEFT JOIN TABLEB B
        ON A.ACCOUNT = B.ACCOUNT
    

    Hello

    SeshuGiri wrote:

    Hi Frank,.

    Your query/solution works very well, but I forgot to mention something in the first post...

    Please insert these additional lines and try the request again.

    TableA Additional lines:

    1. Insert into TABLEA (ACCOUNT, BEGIN, END, QUANTITY)
    2. values ('F9999', to_date (January 2, 2014 ',' dd-mm-yyyy ""), to_date (3 January 2014 ', 'dd-mm-yyyy'), 999.0000000000);
    3. Insert into TABLEA (ACCOUNT, BEGIN, END, QUANTITY)
    4. values ('A1234', to_date (March 3, 2014 ',' dd-mm-yyyy ""), to_date (4 March 2014 ', 'dd-mm-yyyy'), 999.0000000000);

    TableB Additional lines:

    1. Insert into TABLEb (ACCOUNT, BEGIN, END, QUANTITY)
    2. values ('A1234', to_date (March 3, 2014 ',' dd-mm-yyyy ""), to_date (4 March 2014 ', 'dd-mm-yyyy'), 999.0000000000);

    Question 1:

    The table has a rows for A1234 account (i.e. the time period different than the ranks for the same account)

    one is A1234 31/01/2014-03/03/2014, A1234 03/03/2014-03/04/2014

    Your query that returns two rows for A1234 account (which is what I want), but the amount is messed up.

    ACCOUNT BEGIN END TOTAL_AMOUNT
    1 A1234 31/01/2014 03/03/2014 1100
    2 A1234 03/03/2014 03/04/2014 1100

    Except:

    ACCOUNT BEGIN END TOTAL_AMOUNT
    1 A1234 31/01/2014 03/03/2014 101
    2 A1234 03/03/2014 03/04/2014 999

    Question 2:

    In some cases TableA will have an account (F9999), but the TableB don't. I can just this line by making the Left Join right join?

    I don't get the results with additional data. I get 1099 for two lines where account = 'A1234 '.  I get 1100 as the amount on the line with the account = "D5555.  You did it other changes to data?

    Except:

    ACCOUNT BEGIN END TOTAL_AMOUNT
    1 A1234 31/01/2014 03/03/2014 101
    2 A1234 03/03/2014 03/04/2014 999

    Still, I don't see why you want to 101 for the amount of the first row.  Why not 100?

    How can you know which rows from tablea should get attached to what rows from tableb, when the account is not unique?

    Maybe you want something like this:

    SELECT a.account

    b.begin

    b.end

    SUM (a.amount) AS total_amount

    FROM tablea a

    ON a.account = b.account JOIN tableb B

    AND a.begin BETWEEN b.begin

    AND b.end

    AND a.end BETWEEN b.begin

    AND b.end

    GROUP OF a.account, b.begin, b.end

    ORDER BY a.account

    ;

    but I guess just to your needs, and guessing is not a very good or reliable way to solve problems.

    Question 2:

    In some cases TableA will have an account (F9999), but the TableB don't. I can just this line by making the Left Join right join?

    Yes, it looks that you want an outer join.  What happened when you tried?  As always, post your code, the exact results you want from the given sample data, as well as an explanation of how you get these results from these data.

  • Get the data in table of javafx

    Bat I can get the data in table as:

    [code]

    for (int i = 0; i < dtm.getRowCount (); i ++)

    {

    for (int j = 0; j < dtm.getColumnCount (); j ++)

    dtm.getValueAt (i, j);

    [/ code]

    But how can I do this with javafx table? I google and google and google and no luck.

    In JavaFX make data are stored on a basis per line. Each line contains an element of type T (where you have a TableView), and each column specifies a value using a callback function that determines the value of the column of the value of a particular line.

    You can browse the data simply by practice

    for (T item : table.getItems()) {
      // ...
    }
    

    And then get the value of each column for each element of the given line, since you "know" what each column represents.

    For example, in the example of JavaFX documentation, you could do:

    for (Person person : table.getItems()) {
      String firstName = person.getFirstName(); // value in firstName column
      String lastName = person.getLastName(); // value in lastName column
      String email = person.getEmail(); // value in email column
    }
    

    If you want something really generic, you can try

    for (T item : table.getItems()) {
      for (TableColumn col : table.getColumns()) {
        Callback, ObservableValue> cellValueFactory = col.getCellValueFactory();
        CellDataFeatures cdf = new CellDataFeatures(table, col, item);
        Object cellValue = cellValueFactory.call(cdf).get();
        // do something with cellValue...
      }
    }
    

    If you have little chance to this need, unless you write some kind of framework. (I just typed it here, you may have get dirty you with guys a little to make things).

  • Is it possible to see/get the data from the table to a dump file

    I have files dmp generated using expdp on oracle 11 g...

    expdp_schemas_18MAY2013_1.dmp

    expdp_schemas_18MAY2013_2.dmp

    expdp_schemas_18MAY2013_3.dmp

    Can I use a settings file given below to get the data from the table in the file sql or impdp the only option to load the data of table in database.

    VI test1.par

    USERID = "/ as sysdba".

    DIRECTORY = DATA

    dumpfile=expdp_schemas_18MAY2013%S.dmp

    SCHEMAS = USER1, USER2

    LOGFILE = user_dump_data.log

    SQLFILE = user_dump_data. SQL

    and impdp parfile = test1.par.

    No,

    DataPump cannot retrieve a dumpfile data in a flat file.

    Dean

  • How to get the dates of discontinuity

    If there is discontinuity in dates how we write the query...
    I need to get the dates and the dates of discontinuity.
    I / p:

    item_no first_date second_date
    1 January 1, 10 Aug 1, 10

    1-01 - 7.-10 1er January 11

    1 February 1, 11 1 July 11
    "
    "
    "
    o/p:

    1 1 January 10 01 - aug - 10

    1 02-aug-10 (first_date + 1) 31-aug-10(second_date-1) - dates of discontinuity

    1-01 - sep - 10 (second_date) 1st January 11

    1 January 2, 11 January 31, 11

    1 February 1, 11 1 July 11

    '
    '
    '
    Please let me know is possible
    SQL> select  *
      2    from  tbl
      3  /
    
            ID FIRST_DAT SECOND_DA
    ---------- --------- ---------
             1 01-JAN-10 01-AUG-10
             1 01-SEP-10 01-JAN-11
             1 01-FEB-11 01-JUL-11
    
    SQL> with t1 as (
      2              select  tbl.*,
      3                      lag(second_date) over(partition by id order by first_date) prev_second_date
      4                from  tbl
      5             ),
      6       t2 as (
      7               select  *
      8                 from  tbl
      9              union all
     10               select  id,
     11                       prev_second_date + 1,
     12                       first_date - 1
     13                 from  t1
     14                 where prev_second_date + 1 < first_date
     15             )
     16  select  *
     17    from  t2
     18    order by id,
     19             first_date
     20  /
    
            ID FIRST_DAT SECOND_DA
    ---------- --------- ---------
             1 01-JAN-10 01-AUG-10
             1 02-AUG-10 31-AUG-10
             1 01-SEP-10 01-JAN-11
             1 02-JAN-11 31-JAN-11
             1 01-FEB-11 01-JUL-11
    
    SQL>  
    

    SY.

  • How to get the date for the first Monday of each month

    Dear members,

    How to get the date for the first Monday of each month.

    I wrote the following code

    SELECT decode (to_char (trunc (sysdate + 30, 'MM'), 'DAY'), 'MONDAY', trunc (sysdate + 30, 'MM'), NEXT_DAY (trunc (sysdate + 30, 'MM'), "LUN")) FROM DUAL

    But he looks at complex bith.

    Abhishek

    Published by: 9999999 on 8 March 2013 04:30

    Use the IW format - it will make independent NLS solution. And all you need is truncated 7th day of each month using IW:

    select  sysdate current_date,
            trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
      from  dual
    /
    
    CURRENT_D FIRST_MON
    --------- ---------
    08-MAR-13 04-MAR-13
    
    SQL> 
    

    Here is the list of the first Monday of the month of this year:

    with t as(
              select  add_months(date '2013-1-1',level-1) dt
                from  dual
                connect by level <= 12
             )
    select  dt first_of_the_month,
            trunc(dt + 6,'iw') first_monday_the_month
      from  t
    /
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-JAN-13 07-JAN-13
    01-FEB-13 04-FEB-13
    01-MAR-13 04-MAR-13
    01-APR-13 01-APR-13
    01-MAY-13 06-MAY-13
    01-JUN-13 03-JUN-13
    01-JUL-13 01-JUL-13
    01-AUG-13 05-AUG-13
    01-SEP-13 02-SEP-13
    01-OCT-13 07-OCT-13
    01-NOV-13 04-NOV-13
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-DEC-13 02-DEC-13
    
    12 rows selected.
    
    SQL> 
    

    SY.

Maybe you are looking for

  • Low rate display on a good laptop!

    Hello Recently I bought a new laptop called the: HP 15-P032ND Specification of the laptop: Processor: AMD Quad Core A8-6410 2.0 GHz (up to 3.5) RAM: 12 GB / HARD drive: 1 TB + 8 GB ExpressCache Graphics card: AMD Radeon R7 M260(2GB) OS: Windows 8.1 M

  • I don't have any windows XP CD. How can I reinstall my operating system?

    My computer came with windows XP CD. Now I have problems and want to wipe out my computer and return to the factory settings, can someone help me please. Thank you

  • Sharing RAM with video card

    Hey. I have Samsung laptop with video card ATI radeon x 2300 (128 MB) and 4 GB of RAM. I heard that there is a possibility to share some of the RAM of your pc with video card. I don't use all the RAM so I think it would be very good luck to increase

  • Advice on upgrading the hard drive

    Hello: I have a desktop PC HP Pavilion Elite e9220y with its source material. http://support.HP.com/us-en/document/c01859815 I am running Windows 7 64 bit Currently, the PC has a SATA 1 TB hard drive 5400 RPM and I think the upgrade of a Seagate Barr

  • When I click on import, he said, LIghtroom does not...

    When I click on import, he said, LIghtroom does not... I can't import the photos. I open and close lightroom multiple times, sometimes this does not work for hours.