How to get the ISO week number week start date

Hello

I have a table with the following structure
Year    error    Week1     week2   week3 ......week53
2012       error1     2           4         2             1
2012       error2    3          0        1                 1
I was hoping to get something like select year, error, week 1 | "Start date of the week which is a Monday of this week" ", semaine2:" " Earlier this week, Monday again ",... table week53"

Any suggestions please?

Thank you
Sun

Hi, the Sun,

To see what a week N started, add 7 * (N - 1) days of the beginning of the year. (By definition, the beginning of the ISO year is the beginning of week 1 of the ISO year.)

To see when the week started 22 of the current year:

SELECT  TRUNC (SYSDATE, 'IYYY') + (7 * (22 - 1))
FROM    dual
;

I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
Explain, using specific examples, how you get these results from these data.
Always tell what version of Oracle you are using.
See the FAQ forum {message identifier: = 9360002}

Tags: Database

Similar Questions

  • get the calendar week start date

    Hi all

    Is there a function or method in oracle 11g to get the calendar week start date? for example. If 1st week begins January 3, 2011, the function should return January 3, 2011.

    Thank you
    Sunita

    Try this

    SQL> select next_day(trunc(sysdate,'YYYY'),'SUN')+1 from dual;
    
    NEXT_DAY(
    ---------
    03-JAN-11
    

    The solution given by Mahesh is a gross... 3 jan was just for example... not to hardcode

  • Convergence 2u5 - how to get the ISO week number in calendar view?

    Hello

    Convergence seems to be displaying week numbers "US Standard" (e.g. 27/02/2013 is week 8).
    I don't see any option to display European/ISO week numbers (27/02/2013 is week * 9 *).

    You can test on this page: http://www.onlineconversion.com/day_week_number.htm

    Tested with 2u5 and Convergence 2u4.

    Technically, Convergence depends currently dojo to calculate WeekNumber (kernel.js called dojo.date.locale.format that calls dojo.date.locale._getWeekOfYear which uses US Standard).
    The dojox.date.posix.getIsoWeekOfYear method can be called to get the ISO week number.

    EDIT: ok, known problem.
    https://support.Oracle.com/epmos/faces/UI/km/BugDisplay.JSPX?ID=15920988

    And:
    https://support.Oracle.com/epmos/faces/UI/km/SearchDocDisplay.JSPX?_afrLoop=358252901368927 & type = document & ID = 1508601.1 & DisplayIndex = 1 & _afrWindowMode = 0 & _adf. CTRL-State = hy91faqhm_93

    Published by: user13722792 on 27 Feb. 2013 02:03

    Yes, we talk about behavior. However, demand for next development was opened on this:

    15920988 DO WEEK NUMBERING CUSTOMIZABLE IN CONVERGENCE

    More on that we can read in the document of knowledge:
    The numbering of the week in the calendar week view is inconsistent with the ISO8601 (Doc ID [1508601.1 | https://support.oracle.com/rs?type=doc&id=1508601.1])

    It also contains a customization to get Convergence use week numbering.

    If you want to be officially added to the demand of development, you need to open a Service request, which contains this application.

    Cheers, Ben

  • Win version first elements 14 rather than Mac version you downloaded. Serial number does not work. How to get the right serial number

    Win version first elements 14 rather than Mac version you downloaded. Serial number does not work. How to get the right serial number?

    It is unclear what problem you are facing... the wrong version or the wrong serial number.  The serial number is likely for the other version.  You don't want the serial number of Windows or the Mac version?

    One of the following conditions may be useful...

    You can exchange languages/platforms for a newer version product if you follow the instructions on the following link:

    l http://helpx.adobe.com/x-productkb/Policy-Pricing/Order-Product-Platform-Language-swap.htm

    To the link below, click on the still need help? the option in the blue box below and choose the option to chat...
    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Serial number and activation support (non - CC) chat
    https://helpx.Adobe.com/contact.html?step=PHSP-PHXS_downloading-installing-setting-up_lice nsing-activation_stillNeedHelp

  • How to get the original serial number to reload the program on the new computer?

    How to get the original serial number to reload the program on the new computer?

    Hi rehe,

    Please check the KB: quickly find your serial number to find your serial number.

    You can contact our support chat to help retrieve your serial number: serial number and activation support

    Kind regards

    Rave

  • How to get the full phone number?

    I try to get the full phone number using the device.

    I + 1 807 1234567 number and copy the following code:

    Phone *phone = new Phone(this);
    QMap lines = phone->lines();
    foreach(Line line, lines)   {
        if(line.type()==LineType::Cellular)
            phoneAns = line.address();
    }
    

    Gets only 1234567.

    Could you help me, please?

    Thanks in advance

    There could be a problem with the way the SIM card has been implemented.  I would recommend give you carrier a call to see what they say.

  • How to get the name and number of the procedure parameter list or a function?

    I stated the procedure described in the package

    If I want to get the number and the name of the parameter list, so how do I it

    I don't have I her name with the package.

    create or replace package demoApp is

    PROCEDURE insert_data (p_fname IN VARCHAR2,

    p_lname IN VARCHAR2,

    p_address IN VARCHAR2,

    p_cellno IN VARCHAR2,

    p_email IN varchar2);

    end demoApp;

    create or replace package demoApp body is

    PROCEDURE insert_data (p_fname IN VARCHAR2,

    p_lname IN VARCHAR2,

    p_address IN VARCHAR2,

    p_cellno IN VARCHAR2,

    p_email IN varchar2) IS

    EmpID number;

    BEGIN

    Select nvl (max (emp1.empid), 0) + 1 in EMP1 empid;

    INSERT INTO VALUES EMP1 (empid, p_fname, p_lname, p_address, p_cellno, p_email);

    EXCEPTION

    WHILE OTHERS THEN

    raise_application_error (-20001,' insert the problem ' |) SQLERRM);

    END;

    end demoApp;

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

    I want to get the name of the parameter and the number of use of stroredrprocedure ""demoApp.insert_data " "

    Select *.

    of all_arguments

    where package_name = 'DEMOAPP.

    and object_name = 'INSERT_DATA.

  • How to get the clicked page number?

    I created a toolbutton.

    After I active this button I click on the page.

    Implement DoClickProc for toolbutton I get AVPageView and AVDevCoord.

    But how to know the page number, I clicked?

    Thank you.

    Hello

    Try to use the method AVPageViewGetPageNum (inPageView)

    Concerning

    Bartek

  • How to get the processor license number

    Hello

    SQL > select CPU_COUNT_CURRENT, CPU_CORE_COUNT_CURRENT, CPU_COUNT_HIGHWATER, CPU_CORE_COUNT_HIGHWATER, CPU_SOCKET_COUNT_HIGHWATER
    2 license of $ v;

    CPU_COUNT_CURRENT CPU_CORE_COUNT_CURRENT CPU_COUNT_HIGHWATER CPU_CORE_COUNT_HIGHWATER CPU_SOCKET_COUNT_HIGHWATER
    ----------------- ---------------------- ------------------- ------------------------ --------------------------
    48 48 48 48 48

    1 selected line.


    Select
    NUMBER OF SESSIONS_MAX
    SESSIONS_WARNING,
    SESSIONS_CURRENT,
    USERS_MAX of license of $ v;


    1 Select
    2 SESSIONS_MAX
    SESSIONS_WARNING 3,.
    SESSIONS_CURRENT 4,.
    5 * USERS_MAX of license of $ v
    SQL > /.

    SESSIONS_WARNING SESSIONS_CURRENT USERS_MAX
    ---------------- ---------------- ----------
    0 115 0

    How many license for oracle processor I. I think that its 48. Can you confirm me in this matter

    concerning
    Nick

    The number of processors you are licensed for, or in fact whether you use the processor or the username of licensing, are not stored in the Oracle database. It is in license agreement documents you signed with Oracle when you purchased your license. You should return to this paperwork to get this information.

    In addition, if you have 48 cores, it is generally unlikely that you would require 48 licenses processor (at least if you license today the database). Of course, you will have 48 core CPUs, but I guess it's more likely that you have a smaller number of multi-core processors. In which case, you will apply a multiplier of specific material number of nuclei to get the number of required CPU licenses. If you had 12 chips Intel 4 hearts, for example, you would need 24 licenses processor since the Intel multiplier is 0.5. Some chips of Solaris have a coefficient of 0.25. Other chips have a coefficient of 0.75. Given that the rules of Oracle licensing of multi-core chips have changed several times and are likely to continue to change, your license agreement would be critical since you a license of the database to a point in time, if your license agreement sets the terms from that point in time.

    Justin

  • How to get the real serial number of hard disk in a form

    Dear all,

    Can I get the serial number of the disk hard real in a form?

    Help, please


    Thank you

    It seems that HOST() set some environment variables, then the path to the wmic.exe is not found. The following works for me:

    host('cmd /c "c:\windows\system32\wbem\wmic path win32_physicalmedia get serialnumber"'||' > '||'c:\AA.TXT',NO_SCREEN);
    

    François

  • How to get the max sequence number when some record exists in the database table

    Hello

    I need to create the sequence that he should leave value max already exists in the table.

    Example:
    I have a table as below:

    ID NAME
    1A
    1 a
    3 C
    4 D


    Now, during the creation of sequence it should start from 5 but I should ' t START WITH 5 hard-code in the sequence to create. Is it possible to do without Hardcoding the max value in the sequence. It automatically brings the value max + 1 for the next data when I insert.


    CREATE THE TEST_SEQ SEQUENCE. NEXTVAL
    START WITH [Max + 1 val of the table]
    MAXVALUE 9999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    CACHE 20
    ALL;


    Thank you...

    Published by: 998976 on April 18, 2013 04:37

    Published by: 998976 on April 18, 2013 04:38

    Hello

    All the numbers in a CREATE SEQUENCE statement are literals; no other types of numeric expressions are allowed.
    You need dynamic SQL statements to do something like what you want. For example:

    COLUMN     seq_start_col     NEW_VALUE  seq_start
    
    SELECT     1 + MAX (val)     AS seq_start_col
    FROM     table_x;
    
    CCREATE SEQUENCE TEST_SEQ.NEXTVAL
    START WITH  &seq_start
    MAXVALUE 9999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    CACHE 20
    NOORDER;
    
  • How to get the name of a class private data controls?

    How can I get the names of the controls within a class private data?

    I use the framework of the actor and try to create a tha method will be executed when run the actor. This method should an o list all names of control inside the data class to find the initial value within a configuration file (config.ini file), the key to the configuration file will be the name of the control.

    Thank you.

    You already do the substitution method just because you write for the bundle by name.  And then how are you going to respond to all types of data might be the key.  You do more difficult things that it takes to really very few benefits.

  • How to get the Max value with other columns data also.

    Suppose that a query is covered with the data as

    Time of ID
    01 07/12/2014
    02 07/05/2014
    03 16/07/2014
    04 07/07/2014

    I need to get the ID and time to time max.
    that is, should I get
    Time of ID
    03 16/07/2014

    To do this, I wrote a query that gives me necessary data. But I thought that's the best way?
    Is it an effective way to get this data?
    My query that returns the data required is:

    SELECT ID, MAX_DT FROM
    (
    Select 'DUMMY', ID, TIME1, MAX (TIME1) OVER (PARTITION 'DUMMY') AS MAX_DT FROM TAB1
    WHERE ID IN (BLAH BLAH)
    )
    WHERE MAX_DT = (EDT) 1

    Frank mentioned links


    WITH test_data (id, time) LIKE)

    SELECT 01, to_date('2014/07/12','yyyy-mm-dd') FROM dual

    UNION ALL

    SELECT 02, to_date('2014/07/16','yyyy-mm-dd') FROM dual

    UNION ALL

    SELECT 03, to_date('2014/07/16','yyyy-mm-dd') FROM dual

    UNION ALL

    SELECT 04, to_date('2014/07/07','yyyy-mm-dd') FROM dual

    )

    SELECT id, time

    go (select id,

    time,

    Max (Time) on latest_time (order by time lines between unbounded preceding and following unbounded)

    of test_data

    )

    where time = latest_time

    ID TIME
    3 16/07/2014
    2 16/07/2014

    Concerning

    Etbin

  • How to get the CSV file, RTF model output DATA

    Hi, Jorge

    Thanks for your help.

    as in the link you gave the model RTF can have the type of output CSV DATA but in the preview, I see only html, powerpoint, pdf, html, excel.

    How to see the result in SCV, DATA format using my RTF model do I have to do a specific design for these outputs.

    Thnaks in advance

    This is because it has been preconfigured with these outputs.
    Edit and add types of outputs more simply go to:

    1. change your report
    2. click on 'Display list' (upper right corner)
    3. click on the "output formats" (corresponding to your page layout) and
    4. check the formats (add) additional output you want your report to have.

    see you soon

    Jorge

  • How to get the previous week from Monday to Sunday from sysdate

    for example, sysdate is 15-SEP-07 We must retrieve the data from SEPT. 01.-15-06 - SEP - 2015, although 31 August 15 is Monday our application must ignore since the current month is September

    SQL> with t
      2  as
      3  (
      4  select to_date('07-SEP-15', 'dd-mon-rr') my_sysdate
      5    from dual
      6  )
      7  select greatest(trunc(my_sysdate, 'iw') - 7, trunc(my_sysdate, 'month')) start_date
      8       , trunc(my_sysdate, 'iw') - 1 end_date
      9    from t;
    
    START_DAT END_DATE
    --------- ---------
    01-SEP-15 06-SEP-15
    

Maybe you are looking for