Help to get the minimum date of a table which is equal to given date

Hello

My table is as below

Col1 Col2
22 14 MARCH 09
22 17 MARCH 09
22 APRIL 14 09
33 16 APRIL 09
33 17 APRIL 09
33 12 APRIL 09
33 14 APRIL 09

I want the query that returns the date min Col2 and if the date min is equivalent to 14 March 09

This is Min 22 14 March 09 Min 33-12 April 09, I want to just below the result

Col1 col2
22 14 MARCH 09

Kindly help me solve this problem

Hello

Welcome to the forum!

user11834123 wrote:

I want the query that returns the date min Col2 and if the date min is equivalent to 14 March 09

I think that Artacus missed the part about March 14 09.

Assuming col2 is a DATE:

SELECT    col1
,        MIN (col2)     AS earliest_col2
FROM       foo
GROUP BY  col1
HAVING       MIN (col2) = TO_DATE ('14-MAR-2009', 'DD-MON-YYYY')
;

Remember that the DATEs always include hours, minutes and seconds. The above query displays a line only if the col2 earlier in the Group was exactly at midnight (00:00:00) on March 14. If you want any time March 14, change the HAVING clause:

HAVING       TRUNC (MIN (col2)) = TO_DATE ('14-MAR-2009', 'DD-MON-YYYY')

Tags: Database

Similar Questions

  • Get the raw data to map its (SDK)

    I did a search on sound cards and many forums have been useful.  I have just a few quick questions.

    I have a card his (CardDeluxe http://www.digitalaudio.com/) connected to the computer through a PCI.  My goal is to get the raw data from the card and plug and it blow in analytics in CVI.  I don't know how to "talk" to my sound card.

    Of course, my main question is above, but to the refine some concerns...

    I guess I need the SDK libraries for that.  For this, I just need to install the MSN help libraries?

    Is this possible in the Basic Version, or if the full Package of CVI is necessary?

    I have not done things well at low altitude, but it looks like getting a wav file is necessary.  I can't use anything outside of the applications I want to eventually create a program automatically record and play at a time (sync) précis.

    Thanks in advance.

    This site is what I was looking for.  The zip file contains an exe as file c source code.

    http://paulhoule.com/phsrec/index.php

    Edit:

    There is also some info here - http://forums.ni.com/t5/LabWindows-CVI/wav/m-p/235344

  • Deleted his bus from Add/Remove programs by mistake please help me get the sound on my computer. Thank you.

    Deleted his bus from Add/Remove programs by mistake please help me get the sound on my computer. I had downloaded new software I wanted to delete and that which the sound bus (I think that's what it was called was another program added with this software, it is a blue icon) I feel stupid, but really would like help getting the sound back on my computer. I have Windows XP Professional. Thank you.

    Hi Rhonda327,

    Check if an error code is listed in the Device Manager:

    a. Click Start, click Run and then type devmgmt.msc

    b. expand sound, video and game controllers

    c. double-click the sub element

    1. run the system restore. Restore the system to the date when it was working fine. You can check the link for the steps below: how to restore Windows XP to a previous state: http://support.microsoft.com/kb/306084

    2. you can also run the patch from the link below: diagnose and automatically repair audio playback problems:http://support.microsoft.com/mats/no_sound/en-us

    Check out the links that gives you information about the installation of drivers from the manufacturer's Web site and also not to know the manufacturer or the supplier of the device below.

    Link:

    How to update a sound card driver in Windows Vista and Windows XP:http://support.microsoft.com/kb/166774

    Add the above suggestions, you can alos use windows update to install the drivers for the device. Link, please refer to:http://www.microsoft.com/windows/downloads/windowsupdate/learn/windowsxp.mspx

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • How to get the old data 6 months from the current date?

    Hi friends,

    I have a table which includes historical data, which are having more than 1 years old data. The historical table gets updated once a week. My requirement is that I should get the latest data from the week of each month for 6 months according to the current data. I use oracle 10g.

    Can you please someone help in this.

    Thanks in advance

    SELECT last_day (ADD_MONTHS (TRUNC (SYSDATE, 'mm'),-LEVEL))-7 start_dt.
    LAST_DAY (ADD_MONTHS (TRUNC (SYSDATE, 'mm'),-LEVEL)) end_dt
    OF THE DOUBLE
    CONNECT BY LEVEL<=>

    change as a result, I have provided you the start and end dates for your logic...

  • Find the minimum date on multiple columns

    Hello

    I have two questions to find the minimum date on several columns:
    1. need a select query that should JOIN two tables and return any information (CASSEDTL) table with minimum date out of DATEISSUED, DATEPLACED, DATEENTERED and STATDATE.
    2. need of an update query that should update all cases in the CASEDTL table with the minimum date of DATEISSUED, DATEPLACED, DATEENTERED and STATDATE.

    The DDL:
    CREATE TABLE CASEMSTR 
    (   CASENBR     NUMBER,
        DATEISSUED  DATE,
        DATEPLACED  DATE,
        DATEENTERED DATE);
        
    CREATE TABLE CASEDTL 
    (   CASENBR     NUMBER,
        STATDATE    DATE,
        RCVDATE    DATE,
        MODDATE     DATE);
        
    INSERT INTO CASEMSTR VALUES (1, '1 JUL 2007', '1 JUL 2007', '12 JUL 2007');
    INSERT INTO CASEMSTR VALUES (2, '1 JAN 2008', '1 JAN 2008', '21 JAN 2008');
    INSERT INTO CASEMSTR VALUES (3, NULL, NULL, '3 DEC 2008');
    INSERT INTO CASEMSTR VALUES (4, '31 MAR 2009', NULL, '6 APR 2009');
    INSERT INTO CASEMSTR VALUES (5, NULL, '22 MAR 2009', '6 APR 2009');    
    INSERT INTO CASEMSTR VALUES (6, NULL, NULL, '16 JUL 2009');
    INSERT INTO CASEMSTR VALUES (7, '1 DEC 2008', '7 DEC 2008', '26 DEC 2008');
    INSERT INTO CASEMSTR VALUES (8, NULL, NULL, '17 MAY 2009');
    
    INSERT INTO CASEDTL VALUES (1, '25 JUN 2007', NULL, '2 AUG 2009');
    INSERT INTO CASEDTL VALUES (2, '1 JAN 2008', NULL, '2 AUG 2009');
    INSERT INTO CASEDTL VALUES (3, '11 NOV 2008', NULL, '2 AUG 2009');
    INSERT INTO CASEDTL VALUES (4, '31 MAR 2009', NULL, '2 AUG 2009');
    INSERT INTO CASEDTL VALUES (5, '19 JUL 2009', NULL, '2 AUG 2009');    
    INSERT INTO CASEDTL VALUES (6, '13 JUN 2009', NULL, '16 JUL 2009');
    INSERT INTO CASEDTL VALUES (7, '7 DEC 2008', NULL, '16 JUL 2009');
    INSERT INTO CASEDTL VALUES (8, '14 MAY 2009', NULL, '16 JUL 2009');
    COMMIT;
    The initial query I have is
    SELECT CD.CASENBR, CM.DATEISSUED, CM.DATEPLACED, CM.DATEENTERED, CD.STATDATE, CD.RCVDATE, NULL "NEW RCV DT" 
    FROM CASEDTL CD
        INNER JOIN CASEMSTR CM
            ON CD.CASENBR = CM.CASENBR;
    Need to know what is the best way to complete the new Date of RRS? Receive a new date should be the minimum date of DATEISSUED, DATEPLACED, DATEENTERED and STATDATE. And also how do I write an update statement unique to upade date of receipt in the detail table?

    Any help would be appreciated! Thanks in advance!

    Where is the function LESS? Refer to manual SQL.

    HTH - Mark D Powell.

    put1 > desc multdate
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     COL1                                               DATE
     COL2                                               DATE
     COL3                                               DATE
    
    put1 > select * from multdate;
    11-AUG-09 10-AUG-09 01-AUG-09
    
    put1 > select least(col1, col2, col3) from multdate;
    01-AUG-09
    

    Published by: MarkDPowell on August 11, 2009 15:53 added example

  • get the current date for condition satisfied

    Hello world

    I want to get the current date for the following query.

    SELECT B.NAME, C.FST_NAME, C WHERE S_CONTACT, S_ORG_EXT B, C.LAST_NAME OF S_PARTY_PER A (B.ROW_ID = A.PARTY_ID AND C.ROW_ID = A.PERSON_ID AND A.PERSON_ID IN (select D.NEW_VAL from the S_AUDIT_ITEM where D.OPERATION_CD = 'Associate' and OPERATION_DT = 'I want the current date from 07/10/2008 12:00:00 AM to 07/10/2008 23:55:55 '))

    Help, please...

    Hello

    Like this?

    SELECT B.NAME, C.FST_NAME, C.LAST_NAME
      FROM S_PARTY_PER A, S_ORG_EXT B, S_CONTACT C
     WHERE (B.ROW_ID = A.PARTY_ID AND C.ROW_ID = A.PERSON_ID AND
           A.PERSON_ID IN
           (select D.NEW_VAL
               from S_AUDIT_ITEM D
              where D.OPERATION_CD = 'Associate'
                and trunc(OPERATION_DT) = trunc(sysdate)
    --                'i want current date start from 10/7/2008 12:00:00 AM to 10/7/2008 11:55:55 PM'))
    
  • Get the latest data of Variable shared before disconnecting from the network

    Hello.

    I use Shared - published network variables for my communication between two PC's. Each LV software will pass the data to another.

    Sometimes the wireless connection to become really bad and the network connection stops.

    I want to get the latest data. Currently my VI will show the value '0' on the variable shared data once the connection is cut.

    I tried using shift, but she registers the same results.

    Can someone show me how I can stay past data when the network connection is disconnected.

    Thank you very much.

    Kind regards

    Hello Fan, Ravens

    It works! Thank you very much.

    Kind regards

  • Can someone please help to get the drivers/utilities on my Sony laptop to my bluetooth stack?

    Toshiba bluetooth stack, Sony & Windows 7

    "To continue or not to continue the reinstallation of the Toshibas enigma -" Toshiba bluetooth stack "-on a Windows 7 Pro upgrade Vista Pro.

    After a clean install, I lost my beautiful environment of Bluetooth on my laptop Sony vgn-bx51-vn in 2005 (a laptop that is like finding teeth of chicken on the Sony site).  I did a smart thing to keep the "Toshiba" Bluetooth file when I finally removed the windows.old folder after the re-installation.  Only smart because it allowed me to compare models with a pilot of 'original' newly downloaded and files utility (including msi files) Sony - the result was that there are a lot of files that is different.

    They newly installed drivers grumble horribly subject knowing incompatabilities with Win 7 (which is just a skin on top of Vista... or so I thought) and refuse to carry you.  They subsequently take you to Toshiba where you end by abandon the search for any useful help in spite of being a good faith user - no?

    Cut to the Chase.  Can someone please help to get the drivers/utilities on my Sony notebook by hook or crook.  NB. I hope just to aspire to the use of Bluetooth for something useful someday but am also irritated by the cul-de-sac which is software policy.

    Thank you very much - I.

    Ok.

    I mentioned that I had 2 problems - no Wifi and no BT.

    Wifi driver here http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&ProdId=2259&DwnldID=20790&ProductFamily=Wireless+Networking&ProductLine=Intel%C2%AE+Centrino%C2%AE+Wi-Fi+Products&ProductProduct=Intel%C2%AE+PRO%2fWireless+3945ABG+Network+Connectioneng#help

    And here's the fix for BT http://mikescloset.blogspot.co.uk/2011/12/dell-toshiba-bluetooth-350-and-windows.html

    Credit to Mike for the intelligent correction.

  • Can any1 help me get the bluetooth on an inspiron 1525 running

    Any1 can help me get the bluetooth on an inspiron 1525 race I think Norman 2 uninstall the driver and reinstal, but I do not know how to run vista 32 thank you

    Hello

    ________________________________________________

    read these tutorials on how to set up bluetooth:

    How to set up a Bluetooth connection

    http://www.vista4beginners.com/how-to-setup-a-Bluetooth-connection

    Set up a Bluetooth compatible device

    http://Windows.Microsoft.com/en-us/Windows-Vista/set-up-a-Bluetooth-enabled-device

    __________________________________________________________________

    Here are solutions to some common problems with Bluetooth devices.

    You can also try a convenience store for diagnose and fix common problems with equipment and devices running.

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-Bluetooth-enabled-devices

    _____________________________________________________________________

    If the above does not correct it contact the manufacturer of the hardware/device

    __________________________________________________________________

    Here are the drivers for it

    http://support.Dell.com/support/downloads/DriversList.aspx?c=US&l=en&s=GEN&ServiceTag=&SystemID=INS_PNT_PM_1525&OS=WLH&OSL=en&CATID=&impid=

    and a link to a manul cat it

    http://support.Dell.com/support/topics/global.aspx/support/my_systems_info/manuals?c=us&l=en&s=Gen& ~ CK = anavml

  • problem to get the current date in qml

    Hello world

    I'm trying to get the current date in c ++ and qml and I used the class QDate, but it still has some problems:

    Code:

    =====================================================

    QDate * nowdate = new QDate;
    QDeclarativePropertyMap * nowdateMap = new QDeclarativePropertyMap;
    nowdateMap-> insert ("date", QVariant (nowdate-> currentDate()));
    QML-> setContextProperty ("nowdateMap", nowdateMap);

    ===========================================================

    After setting the nowdateMap, I'm able to get the date in the application, but the format is really weird, I did not use QDatetime, but the restult of shows like ' 2013-1 - 3 T 00: 00:00 ", how can I get rid of the final"T00:00:00 "? or is there a better way to get the current date?

    Thank you

    QDate nowdate is QDate::currentDate();.

    QString nowdatestring = nowdate.toString (); / / to get the date string format, you can define the shape of toString(), you can //search it
    QDeclarativePropertyMap * nowdateMap = new QDeclarativePropertyMap;
    nowdateMap-> insert ("date", QVariant (QString (nowdatestring)));
    QML-> setContextProperty ("nowdateMap", nowdateMap);

    then in the file qml, using nowdateMap.date will do.

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format.  How can I get the pdf data into the columns and rows?

    I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format.  How can I get the pdf data into the columns and rows so that I can do the calculations?

    If you start the https://forums.adobe.com/welcome Forums Index

    You will be able to select a forum for the specific Adobe products you use

    Click on the symbol "arrow down" on the right (where it is said to see all our products and Services) to open the drop-down list and scroll

  • How to get the current date to display in the Spanish format.

    The coding is in format Adobe Acrobat, DC. The coding I have for the English today's date is:

    var d = new Date();

    sDate = util.printd var ("dd mmmm yyyy", d);

    this.getField("Text1").value = sDate;

    How can I get the current date displayed in this Spanish format: 07 December 2015

    Thank you

    It's a little complicated... But this code should do the trick:

    util.printd("dd", d) + " de " + util.printd("date(es){MMMM}", d, true) + " de " + util.printd("yyyy", d);
    

    Edit: Fixed the code... Did not notice the 'of' second before.

  • Hi need help I get the error message "Download error, Undefined" in the applications tab to install Apps. Can someone help?

    Hi, I need help, I get the error message "Download error, Undefined" in the applications tab to install Apps. Can someone help?

    Follow the procedure below and check:


    End Adobe partner all tasks in the Manager of tasks like creative cloud, CoreSync, AAMUpdater... etc.

    Uninstall Adobe Creative Cloud application.

    If you face any problem try CC Uninstaller:

    Using creative cloud | Uninstall the creative cloud desktop application

    After removing Adobe Creative Cloud applications, follow these steps:

    Step 1:

    Open the c: drive and navigate to C:\Program Files (x 86)------\Adobe " common files".

    Open the Adobe folder and delete folders named Adobe Application Manager and OOBE.

    Step 2:

    Navigate to C:\Program Files (x 86) \Adobe.

    Open Adobe file and if present the file to remove Adobe Creative Cloud . [* important]

    Impossible to remove?

    Rename it as Adobe Creative Cloud-old.

    Step 3:

    Press Windows button (located between Ctrl and Alt buttons) with the key R together at once, you will get a command window.

    Type below command and press the enter"" key.

    AppData

    Then go to the Local > Adobe.

    Open the Adobe folder and delete folders named AAMUpdater and OOBE.


    Step 4:

    Temporarily disable anti-virus and firewall.


    (1) open Control Panel and then click on the network and Internet"" option.

    2) click on Internet options, click on the tab "connections".

    (3) in the 'Connections' tab, select 'LAN' settings, you will be able to view the LAN settings box.

    (4) check the box-"automatically detect settings" and then "uncheck" all the other boxes as "configuration Script auto use", "Use a proxy server," proxy server ", then click on the ok button."

    5) click on the "Network settings" button once again, make sure that "Automatically detect settings" is the only option you select, the window of properties of LAN so clear.


    Step 5:

    Make sure that Adobe Creative Cloud is not listed in the control panel > programs and features. list.

    Then, download and install the Adobe Creative Cloud app and check.

    https://ccmdls.adobe.com/AdobeProducts/KCCC/1/Win32/CreativeCloudSet-up.exe

Maybe you are looking for