Deriving from the first day of the week ww in the year yyyy

I need to be able to display the first day of a particular week in addition to the "week of the year" and the year. for example:
select to_char("ServiceDate",'yyyy-ww') as "Year/Week", sum("Points") as "Points"
from my_table
group by to_char("ServiceDate",'yyyy-ww')
order by to_char("ServiceDate",'yyyy-ww')
give me the following:
Year/Week     Points
2008-33            1                      
2008-35            1                      
2008-42            4                      
2008-43            2                      
2009-01            1                      
...
and so on. What I would like to add to the dataset is the same day, the first day of the week for this week/year. For example, the first line would look like this:
Year/Week     1st day of week     Points
2008-33          08-AUG-2008*         1
* Or whatever the first day of the week 33 of 2008 is (assuming that "first day of the week" is a Sunday, in my case).

My brain is on "dim" right now; any help is greatly appreciated.
Thanks in advance,
Carl
select  to_char(trunc("ServiceDate",'ww'),'yyyy-ww') as "Year/Week",
        to_char(trunc("ServiceDate",'ww'),'DD-MON-YYYY') "Week Start Date",
        sum("Points") as "Points"
from my_table
group by trunc("ServiceDate",'ww')
order by trunc("ServiceDate",'ww')
/

SY.

Tags: Database

Similar Questions

  • Derives from the system time when calling OR-Motion screw on PXI controllers

    Hello

    Just an email to avoid others wasting time when they are facing in this fantasy bug:

    We use PXI systems with Controllers NI PXI running Windows 7 and the 7340 family cards (PXI-7344). We have noticed that when the calls when it's through screws OR-Motion to question the different registers of the State (e.g. position, ADC value, general axis or the reference state) axis, the (Windows) system clock runs FASTER either. OR-Motion calls most are performed per second, faster windows clock works. When you get into the status for 4 axes 10 times per second (lines 100 ms rate), the drift is greater than 5%!

    I include here an example of program that reproduces this behavior.

    It is an essential question, for example if save you data with or from the timestamps, and it gets even worse if Windows is configured to periodically synchronize its own clock to a server via the NTP Protocol (it's how we noticed this problem in the first place). In this case, you see large discontinuities in your data every once in a while. Our systems must be running automatically and record data continuously throughout the year, so this bug is a real challenge.

    People at NOR been able to reproduce this bug too and are working on it (no idea of any CAR # yet). Note that this problem has not been seen on a DC non - OR Office running Windows 7 64 bit...

    The exact configuration is the following:

    Chassis PXI-1036

    PXI-8101 (or PXI-8102 on another system) controller

    4 PXI-7340 axes into the Groove 4, no physical connection for this test

    (PXI-6221 in slot 2, not used in this sample program)

    Windows 7 Enterprise SP1 32-bit English

    LabVIEW 2011 SP1 32-bit English

    OR-Motion 8.3

    2.6.2 PXI platform services

    (all software OR additional distribution 2012 DS1)

    Controller BIOS: improved 1.3.1 to 2.0.1f0, problem given the two versions of the BIOS

    I'll try to post here as soon as we receive news of NEITHER.

    Kind regards

    Vincent

    Hi all

    I wanted to let you know that the driver OR Motion 8.4 coming should solve this problem.

    Best regards

  • 'CREATE JAVA' error: ORA-29506: derived from the USING clause invalid query

    Hello

    I created a table with the following attributes:

    name varchar2 (200);
    LOB_DATA blob


    I loaded a java source file in the lob_data blob.

    I then called the SQL:

    create or replace and compile the java source named "RemoteCommand" using blob
    Select lob_data from str_blob_table where name = 'RemoteCommand.java ';

    and I get the error:

    ORA-29506: invalid query from the USING clause
    ORA-00936: lack of expression
    29506 00000 - "query invalid derived from USING clause.
    * Cause: The USING clause does not form a valid query.
    * Action: Correct the USING clause.



    If I simply copy and paste the query part of the USING clause:

    Select lob_data from str_blob_table where name = 'RemoteCommand.java ';

    I get a valid result in SQLDeveloper.


    Any thoughts on what is happening here?

    A few notes:
    1. it is a 8i database.
    2. it works very well on a 9i database, but according to the SQL reference for 8i, it should work as well.

    Thank you
    Brent

    Try to delete "select" in the USING clause, that is to say change the SELECT BLOB SUPPORT... for BLOB to HELP... The original form of the syntax of JAVA to CREATE did not expect the SELECT token must be explicitly provided. Somewhere between 8i and 9i the parser was changed to try the provided text as well as what, with SELECT prefixed. So a CREATE JAVA statement you tried working in 9i but in 8i fails because SELECT would always be added before you try using the clause as a query, resulting a SELECT duplicate token.

  • Derived from the initials of first names

    Hi all

    I need to derive the initials of first names.

    Can anyone help?

    Kind regards

    Chris

    Ok then... Here's the script to do. At the end of the variable named

    "initials" will hold the trigger guard of the entered name:

    name = 'John Doe';

    splitName = name.split("");

    "" initials = "";

    for (i = 0; i

    Post edited by: try67

    Forum has screwed up the code... (once again...)

  • Deriving from the country, state/province telephone number Codes

    Is it a practice of good (or bad)?  I want to program a step that derivative of country codes and state/province based on the initial number in the phone field (in our washer contact)?

    For example, if the phone number begins by + 091 (or 91, + 91) the country code must be IN; + 094 would be Sri Lanka.  We would run this step in the case where the perspective between our system with a address freemail (gmail, yahoo, etc.) and a phone number, but nothing else

    Countries might not be bad, but nothing else, and you might not get what you are looking for.  For example, I have 4 numbers on my 'family' of cell phone plan.  I have a number of Texas, my wife a number of Illinois, and one of my other lines is a number of Utah.  With the ease of portability of numbers from carrier to carrier and the appearance of everyone having unlimited long distance (at least here in the United States) no matter if you have a local number, or more.  I haven't lived in Utah in 6 or 7 years, but if I got an email that applied only to Salt Lake City it might not be the best experience.  I was in Illinois for a year and a half and do not rely on the number of Texas (my first) to landing any time soon.

    My 2 cents.

  • Derived from the existing columns

    Hello

    How to create a new column that has derive data from another table on this logic:

    Table A
    Name identity
    1 dsf
    2 homeless
    3 SDS

    Table B
    ID name tableA_ID
    1 dd 1
    2 of 2


    I added another column in table A in desperation to denormalize our data and didn't need to make a join to table B
    ID name tableB_name
    1 SD dsf
    2 sdf of
    3 SDS

    basically just try to merge 2 tables with a 1-1 relationship. I tried to fill in the data of table B in A, but by making an inner join and when I query the data, does not return a row ID 3 in table a.

    In model MDB make outer join. Make sure that you select next outdoor table.

    Score pls correct/good

  • How are derived from the random bits for new AESKey()?

    I was not able to find any documentation on how the random key is generated. There has been discussions on various security forums recently on the use of random number generators nickname (PRNG).

    I would like confirmation that the random bits for new AESKey() come from cryptographically safe pounds (like net.rim.device.api.crypto.RandomSource?).

    Random data used in the constructor of AESKey() comes from net.rim.device.api.crypto.RandomSource.

  • Derived from the table

    How can I differentiate a table? When I connect the same table to the full block he automatically understands as a function of z(x,y). I can't do the same thing with the drift.

    What should I do?

    Thank you


  • Derives from the screen

    My screen seems to drift to the right on my monitor.  This is particularly noticeable when I open an email; the bar up/down is partially hidden on the right.  So today I opened a game, and the screen is low and to the right 3/4 of an inch.  I don't see any monitor controls and I can't seem to find help in my computer.

    See the documentation that came with your monitor or Google the model number and visit the manufacturer support site for a user manual.

    Possibly on the (lower) edge or feel it for several small buttons, maybe next to the power. It takes to a menu - what you are looking for is the OSD section for vertical and horizontal position, some monitors have a definition also auto. Using the menu and the + and - buttons should allow you to correctly position the screen in the monitor.

    I hope this helps.

  • Deriving from the value of the column totals

    BI Publisher 11g:

    I have the next report, that I generated:

    BOX TYPE NUMBER OF BOXES COST COST PER BOX
    A10$100$10
    B20$140$7
    TOTAL30$240$17

    My problem is that in the TOTAL row in the column COST PER BOX, the value shouldn't be that is to say $17 ($10 + $7) it should be actually IE $8 ($240 / $30). Does anyone know how to calculate the correct value.

    Assuming that this structure of xml data:

    A

    10

    100

    B

    20

    140

    You can use the following code to get the values:

    row1:  

    row2: 

    Thank you

    Bipuser

  • Get a NAMED check constraint when the entity attribute derived from the field

    I'm designing a new database and beginning with a logic model of the ER. I've defined several areas, such as the NO_YES field (with values of ' no and 'Y'). When I use this area as a data type of an attribute of the entity (for example, the CHANGE_REQUEST.IS_APPROVED attribute), I also specify a constraint name (for example, CR_APPROVED_CK) of the attribute (this is done in the Group of constraint, property name constraint and the properties of the attribute dialog box, default value).

    When I have the logic model to a relational model of the engineer, the constraint name is lost. Specifically, for the definition of the table that is created, for the column in question, in the default column properties and constraints Panel dialog box, the name of constraint property is empty. When I generated the DDL of the relational model, the check constraint that is generated is an inline check constraint (such as ' IS_APPROVED VARCHAR2 (1) CHECK (IS_APPROVED IN ('n', 'Y')) '). When this DDL is executed to generate database objects, the created check constraint has a system-generated name. I want the constraint to have a name that I create.

    By experimentation, I found that in the relational model, if I specify a value for the property name of the constraint in the DOF resulting constraint get named (an ALTER TABLE statement is generated that contains "ADD CONSTRAINT CR_APPROVED_CK CHECK (IS_APPROVED IN ('n', 'Y'))"). However, I have redundantly change the relational model in the same way that I edited the logic model to specify the constraint names.

    Is there a way to guarantee that the constraint names defined in a logic model transferred during the engineering of a logic model to a physical model.

    The version of the Data Modeler I use is 3.0.0.665.

    Is there a way to guarantee that the constraint names defined in a logic model transferred during the engineering of a logic model to a physical model.

    There is ' compare/copy options' tab in the technical dialogue - clear the checkbox "do not apply to new objects.

    Philippe

  • How to get the first day of the week on the calendar?

    Hello

    I'm storing calendar weeks in my database. for example 30/2013.

    How can I get the first day of this week (Monday)? in this case, it is 22.07.2013

    THX

    Anja

    with your_table as)
    Select 30-2013' double your_column
    )

    Select
    trunc)
    TO_DATE ("0101"
    || (substr (your_column,-4), 'MMDDYYYY'), 'IW')
    + to_number (substr (your_column, 1, 2)) * 7-7
    start_of_week
    from your_table

    START_OF_WEEK
    22/07/2013

    Post edited by: chris227
    Corrected example

  • Accounting of the derivative of the signal

    Hello

    I am a beginner LabVIEW-user and I have a question that maybe painfully obvious for a more experienced user.

    I use a precision Sartorius CP225D balance to save the change of mass scale mg due to withdrawal and the dispensation of a fluid in a container. What is the piece of blocking air flow, bringing the temperature of the room and immutable or reposition the initial load for several hours, a fairly linear and continuous negative drift will occur for the display of the balance. This drift occurs without worrying if there is anything on the scale or not. I use VI Sartorius provided to read and note the readings.

    How can I use LabVIEW to adjust this signal for this negative drift using the linear relationship I can derive from the previous examples of execution? I tried to collect the signal of the difference between the display of the balance and the linear relationship that I approached, but with time, even this manipulated signal falls to the display of the exact balance if he were allowed to run without being manipulated. Better yet, how can I manipulate the signal of a frame sequence curve flat prior connection for the signal already recorded in the following picture?

    I would appreciate any guidance or assistance that could lead me to a solution. I tried to contact helpline Sartorius, but little help was offered. I will share as much information as possible.

    Thank you for reading this,

    Zach

    Zach,

    The instrument drift probably not linearly forever or the value wouldn't finally out of reach.  The manual I have donwloaded requires 30 miniute, 4 hours or 24 hours of warm-up, depending on the model and the application.

    You can try saving records once per minute for 24 hours, starting by an intstrument of cold and let it run as stable an environment that you have available? Note the temperature, if possible.  Never stabilizes the drift?

    What is drifting from the signal you need to measure? What is drifting? How fast your fluid distribution affect the readings?

    Lynn

  • How can I change the clock from the fpga to the entire code

    Hi I am new to the labview and using 8.6 demo (fpga modules in real time).

    I developed some codes to practice and you want to change the clock freq 200 MHz of 40 M for all codes.

    I mean how to use clock derived for my vi.

    You create a clock FPGA derived from the "clock of 40 MHz on board" in the project manager.

    Then in the properties for the FPGA, you can select 'Top level Clock '.  High level for the FPGA clock can be that what follows: 80 MHz, 120 MHz, 160 MHz, 40 MHz, 200 MHz

  • Why can't create shades of color from scratch (not derived from photo)?

    Hey Adobe-ers,

    I am a long-time Adobe product user, and I used the tools of color from Kuler. It is disconcerting that the mobile versions of this tool (CC color then its subsequent integration with catch CC) do not seem to give you the means to create shades of color from scratch - instead requiring an input image and picking color points.

    It seems obvious that finding inspiring colour combinations of your external environment (and take a picture of them) and derived from the color combination of your imagination, is completely different creative workflow that can the two place to the creation of assets of color. Only the former mode (probably more complex) is supported seems quite bizarre!

    I appreciate really new workflows that adobe have aroused, especially on the use of cloud storage to make simple goods to share between machines - but I'd love to have a place to create shades from scratch (in the way of the CC of color web - app) without the workaround of blocking pipeline creative to have to take a picture at random and then change the colors derived from distraction to possibly meet what I had imagined.

    PS Apologies in advance integrated;  There is a way to do and there is just something missing me, this has been answered, or if this is not the right place for feature requests etc.

    Hello Stephen,

    Thanks for that. No, you do not miss anything. This feature is only in the web version of the application. From time to time, we receive requests, to incorporate it into the app now in the mobile version, you need to capture a theme. Then change it.

    I'll leave a note for the team with your comments.

    And, just to alleviate any concerns... the right place for your comments is everywhere where it is easier for you to leave. Finally, we see (and try to respond to) everything.

    Thanks again.

    Sue.

Maybe you are looking for

  • 42mm link chain Stainless Steel Bracelet black space - is comfortable

    I have a fly black stainless steel - Apple Watch, I currently have an Apple black leather loop on that I really like, but this loop is a replacement like the other loop leather split after only 3 months. So I was thinking about buying the 42 mm Brace

  • On my Satellite P100-347 cooling fan runs all the time

    Hello I think I might have a problem with the fan on my Satellite P100-347. He seems to be constantly works constantly and is much stronger than when I bought the computer. Initially he just spent and if so, I think that this could now be wrong.Help,

  • Blue screen error during hibernation

    Hey all.  I've looked through the forums and cannot find a solution to what I saw.  I have a home network that consists of my main office directly connected to my internet cable and two laptop computers HP connected by wifi.  My House has some dead s

  • C++ Runtime Error help me solve this problem...

    I have tried every thing in the internet, and yet I can't find a solution for this error. I reinstalled windows, and yet, I get this error. Please help me to solve this error.

  • Prefer IPV4 to IPV6

    Even if we do not have IPV6 enabled on all types of adapters our domain servers and windows 7 desktops still seem to resolve IPV6 addresses. We run a Microsoft difficulty he 50410 and this solves our problem but only for a short period of time. Not s