question stupid sql

Hi all

OK, it seems stupid for you gurus, but for the life of me, I can't understand how to write sql code to get the results I'm after! :
CREATE TABLE schedule
   (
     Sch_Id NUMBER(9) DEFAULT NULL,
     Schedule_Date CHAR(8 BYTE) DEFAULT '00000000' NOT NULL,
     Prog_Name VARCHAR2(100 CHAR) DEFAULT ' ' NOT NULL,
     Start_Time NUMBER(10) DEFAULT 0 NOT NULL
   );

INSERT ALL
    INTO schedule (Sch_Id ,Schedule_Date,Prog_Name,Start_Time) VALUES (null, '20120501','Documentary1',3600)
    INTO schedule (Sch_Id ,Schedule_Date,Prog_Name,Start_Time) VALUES (1, '20120501','Documentary1',3610)
    INTO schedule (Sch_Id ,Schedule_Date,Prog_Name,Start_Time) VALUES (null, '20120502','Documentary2',5400)
SELECT * FROM dual;   
The Sch_Id column represents the type of program they are watching. NULL corresponds to the ' regular ' and '1' is a 'real' schedule

Users will see 3 options from a radio button, let's say 'regular' (this is the default), 'real', 'to the request/real.

Of course, there of not much to it when they select planned or real, but, how the code such that when they choose option planned/actual, that the results will be like that? :

Sch_Id, Schedule_Date, Prog_Name, Start_Time
1, 20120501, Documentary1, 3610
NULL, 20120502, Documentary2, 5400

Basically, means "at the request/actual" If there is a 'real' calendar, pull and do not hold account of the "regular". Therefore, this is why there should be two lines of data for this date range.

Does make sense?

Any help would be greatly appreciated!

Thanks to you all.

Hello

I don't know if I really understand your needs, but I think you want something like this:

VARIABLE  r_button    VARCHAR2 (20)
EXEC     :r_button := 'scheduled/actual';

WITH      got_r_num    AS
(
     SELECT     sch_id, schedule_date, prog_name, start_time
     ,     ROW_NUMBER () OVER ( PARTITION BY  schedule_date
                               ORDER BY          sch_id     NULLS LAST
                       ) AS r_num
     FROM    schedule
     WHERE     (   :r_button     != 'scheduled'
          OR  sch_id     IS NULL
          )
     AND     (   :r_button     != 'actual'
          OR  sch_id     IS NOT NULL
          )
)
SELECT       sch_id, schedule_date, prog_name, start_time
FROM       got_r_num
WHERE       r_num     = 1
;

This query returns (at most) 1 row for each schedule_date.
If: r_button is 'real', the row will have a sch_id not NULL.
If: r_button is 'regular', the row will have a NULL sch_id.
If: r_buttone is ' schdeuled/real' (or something other than the above), the row will have a sch_id not NULL if possible, but it will be a sch_id NULL if there is no other for this schedule_date.

Furthermore, the storage date information in any type of data except the DATE (or TIMESTAMP) is not a very good idea.

Tags: Database

Similar Questions

  • question stupid sync

    Stupid iPhone has a new stupid software. I thought that I would update so it would interrupt bothers me and I would be able to use the latest operating system and so my iPhone would be as slow as possible while offering the latest stupid. But I clicked on update now and got this message:

    "Update to iOS 9.3.3 requires at least 610 MB of free space on your iPhone. Please change your synchronization of media options to make more available storage. »

    I have no idea how to do to change the synchronization of media options and I don't want to know. I want just the iPhone stupid to work like a stupid iPhone and stop bothering me.

    According to Itunes, I 2.3 gigabytes of storage space on this phone. It is much more of 610 MB, according to information available to me.

    The question, not that I care much, is

    • How can I do this and

    • Why so stupid Apple and why is Itunes worse than Microsoft Word to make clear to users?

    generally, when this message occurs, try the following:

    back up your phone with iTunes or iCloud.

    Settings > general > use of storage/iCloud > storage management >

    delete all the files that you don't need.

    perform the update

    as for question 2, you can say apple because they don't come on these forums looking for criticism. The site of discussions is strictly a volunteer service

    Apple.com/Feedback

  • IAAS configuration question - database SQL

    I have questions, get the IaaS of vRA setup part.  When installing, I get an error message saying 'domain user iwic\vra.svc is invalid or the database to access denied.  Validation error 1385. "This has occurred trying to connect to a SQL cluster and with a local installation of SQL on the server of IaaS.  I excluded the problems of firewall, ensure that the vra.svc has full right to SQL server, verified password admin and correct username.  At this point, I'm stuck and looking for help on getting this Setup is complete.

    install error.tiff

    The issue ended up being with the port number of the SQL instance.  The port number for this instance of SQL changed and I do not have this information.  When I was with SQL Management Studio to connect to SQL server, it requires a port number during installation of vRA you must know the correct port of the SQL cluster number.

  • question about SQL and VMDK places

    Hello world. Im kinda new here so please be gentle

    I'm confused on the locations of the files for sql.

    At this moment I have 1 with 3 vmdk files sql server executes a muscular 100 GB sql database.

    My disks are as follows

    1 OPERATING SYSTEM

    2 DB

    3 newspapers

    They are all thick and they are all stored with the virtual machine in the virtual machine configuration.

    It lies in a cluster HA/DRS and we use them both.

    The question boils down to performance.

    If my VM is stored on DATASTORE_A and the VM folder on this data store has all the VMDK files in it, it would be safe to say that they are all on the same disk as much as vsphere is concerned.

    Now to get best performance, I want to separate my VMDK files to separate data (with faster operation) warehouses to avoid conflicts of drive on my current data store. What is the right way to go about this?

    How separate you your VMDK to other data warehouses, and enjoy other performance data store? WE do not use DTS at all so im sure it although we use HA/DRS in our group... and yet, I don't think that it is important in this case... just more of an FYI.

    What do you do to get your SQL servers to run in vmware?

    Seems like a basic question.

    The answer seems easy. Separate disks so that they do not fight.

    'S virtually done it with VMDK but the data store underlying is 1 speed and they all exist on this subject, so... How to separate them at that level for best performance?

    Also... once I keep them separated, how can I keep my sanity by knowing my VMDK are not with the virtual machine? This kind of made a mess . Of course the performance takes a front seat for my mental health.

    Thank you all

    1. If I sVmotion my other vmdk files via the advanced options of one in another data store, it will create the files folder structure based on my VM name and place the vmdk inside?  (I guess I could just test it and see).

    Yes, the VM configuration file (.) VMX) will be modified to point to the new location of the virtual disk. You can use the virtual machine property editor to check for this, once the Storage vMotion.

    2. with regard to the disk controller, I assume you mean a virtual controller by VMDK in the vmx / correct the settings of the virtual machine and not a phyical on the hardware controller? (IM pretty sure I know the answer here but I just want to be clear).

    Yes, the virtual controller is correct.

    If so, what type of controller? LSI Logic or it would benefit all a paravirtual adapter?

    As long as your operating system is supported, go with the PVSCSI every time - especially for newspapers and the controller file data.

  • General question about sql DB to vcenter

    Basically, we need to know how many connections SQL DB to go from one instance of vCenter 5?

    It is dependent on host?

    It is dependent on comments?

    Is there a way we can we estimate how many connections?

    DBA SQL told us we have currently a large number of connections, but we do not think that this could be cauisng questions.

    vCenter uses a connection pool (10 by default as he answered already). This is usually done by web application to manage db connections required by multiple login sessions (no need to reopen a db for each session connection... open a db connection sometimes takes more time that select it dumb that they do).

  • Question about SQL * connect more in the syntax

    Good evening

    I can connect successfully from the client to the host using the following command:
    0 19:40 [Oracle] [23G] [569M] E:\Client>sqlplus scott/abc123@dbca
    
    SQL*Plus: Release 11.2.0.1.0 Production on Sun Aug 22 20:01:56 2010
    But I wanted to omit the password, so I tried:
    0 20:03 [Oracle] [23G] [590M] E:\Client>sqlplus scott/@dbca
    thinking that SQL * more tempt me the password but, if it does at all. I tried in vain a few variations. I read the specifications of command line for SQL * more and it seems that this command should work.

    Questions: What is the problem with the command I typed and what is the correct syntax?

    Thank you for your help,

    John.

    To omit the password using connect scott@dbca , but do not connect scott/@dbca of sqlplus.
    or sqlplus scott@dbca

  • Question of SQL statement

    I have this PreExpression at a stage of SQL statement:

    Locals.SQL_LatestResult = "SELECT UUT_RESULT.ID, UUT_RESULT. UUT_SERIAL_NUMBER, UUT_RESULT. START_DATE_TIME UUT_RESULT WHERE (((UUT_RESULT. UUT_SERIAL_NUMBER) =------"' + Locals.serial + ' \ ') AND ((UUT_RESULT." START_DATE_TIME) = (SELECT MAX (UUT_RESULT2. START_DATE_TIME) OF UUT_RESULT AS UUT_RESULT2 WHERE UUT_RESULT. UUT_SERIAL_NUMBER = UUT_RESULT2. UUT_SERIAL_NUMBER))); »

    Locals.SQL_LatestResult has this value after the PreExpression:

    SELECT UUT_RESULT.ID, UUT_RESULT. UUT_SERIAL_NUMBER, UUT_RESULT. START_DATE_TIME UUT_RESULT WHERE (((UUT_RESULT. UUT_SERIAL_NUMBER) = "15514011") AND ((UUT_RESULT. START_DATE_TIME) = (SELECT MAX (UUT_RESULT2. START_DATE_TIME) OF UUT_RESULT AS UUT_RESULT2 WHERE UUT_RESULT. UUT_SERIAL_NUMBER = UUT_RESULT2. UUT_SERIAL_NUMBER)));

    I get the number of records = 0, if I run the sequence.

    If I copy the exact same SQL query in access I get what I want to know a record.

    If I remove that part of the query:

    ((UUT_RESULT. UUT_SERIAL_NUMBER) =------"" + Locals.serial + "\") "

    I get 388 records which is correct and it run directly in access.

    What's not here?

    I was too fast for this post... it's my fault, the database link was wrong, so data were there...

    Statements are very good!

  • Question about SQL server 2008

    I can't remove the Default constraint in Management Studio. But in the query, I can drop Default constraint

    For assistance please ask for help in the appropriate Microsoft TechNet SQL Server Forums

    Thank you & good luck.

  • Question to sql server oracle DBlink

    Hello

    I followed steps below

    1 connection configured and tested ODBC connection is successful and ODBC calls SQLT.

    2. I added under entry in the C:\app\product\11.2.0\dbhome_1\hs\admin\initdg4odbc.ora file

    HS_FDS_CONNECT_INFO = SQLT

    HS_FDS_TRACE_LEVEL = OFF

    3. turn under entry in the tnsnames.ora file

    SQLSERVER =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = tcp (PORT = 1551))(HOST=mylocalhostname))

    (CONNECT_DATA = (SID = dg4odbc))

    (HS = OK)

    )

    * I also tried SID = SQLT in tnsnames file

    4. added under entry in the listner

    SID_LIST_SQLSERVER =

    (SID_LIST =

    (SID_DESC =

    (ORACLE_HOME = C:\app\product\11.2.0\dbhome_1)

    (SID_NAME = dg4odbc)

    (PROGRAM = dg4odbc)

    )

    )

    ADR_BASE_SQLSERVER = directory

    SQLSERVER =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP (PORT = 1551))(HOST = mylocalhostname))

    )

    * I also tried SID_NAME = SQLT file listner

    5 lsnrctl reload

    6 created db link

    CREATE SQLSERVER1 LINK DATABASE to CONNECT to 'MyUser' IDENTIFIED BY 'Mypassword' USING 'SQLSERVER ';

    but still I am getting below error.

    ERROR on line 1:

    ORA-28545: error diagnosed by Net8 when connecting to an agent

    Cannot retrieve the text of the message NETWORK/NCR 65535

    ORA-02063: preceding 2 lines of *.

    I also followed link below

    https://Oracle-base.com/articles/Misc/heterogeneous-services-generic-connectivity

    even that also does not work. kindly help me

    Hello, it seems that listener or HS is not allowed.

    Check the status of the listener, then try with HS_FDS_CONNECT_INFO =:/ / in initdg4odbc.ora

    Do

    c: > lsnrctl stop SQL SERVER

    c: > lsnrctl start SQLSERVER

    run

    c: > lsnrctl status SQLSERVER

    and after release.

    This OPINION score could be useful 234517.1.

    Concerning

  • Question of SQL monitoring control 12.1.0.4 clouds

    All the

    I used 12.1.0.2 EM cloud control for awhile and since the run to monitor SQL screen I have had direct access to bind variables in the SQL statement monitored.

    before_Screenie.jpg

    This feature doesn't seem to be available in 12.1.0.4, or, if this is the case, it seems to be very hidden...

    Clues on where I can easily find this information from within the EM CC on 12.1.0.4?

    We have an answer!

    In the main, (followed by executions SQL) view SQL monitor locate the SQLID you are interested and make your cursor the status"" column.  Click on the status icon-

    This will bring you down to the detail of SQL executions and to the right you will see the "View report" button that is not monitored in the other view.  Click on it and you have your information variable bind in the report.

    Thank you!

    Micheline

  • Question: Is SQL Server 2014 on the roadmap for vSphere?

    Hello community,

    one of our clients is planning to implement Microsoft SQL Server 2014.

    Is SQL Server 2014 on the roadmap for VMware vSphere and the Update Manager?

    Or is it possible and supported to run vSphere 5.5 on a Microsoft SQL Server 2014.

    Kind regards

    Michael Winkenbach

    Hi Michael,

    Here you can check what VMware products are supported on what databases: VMware product interoperability Matrices

    MS SQL 2014 is not yet.

    Perhaps the next major release of vSphere will support it. Maybe we'll here on this subject at VMworld?

    So far I would say your client to not migrate databases of vSphere.

    Tim

  • Installing vcenter 5 new questions (linked SQL)

    Number of steps 2, 3, 4 and 5 of the "Configure Microsoft SQL Server databases" section of the "vSphere Installation and configuration - vSphere 5.0.pdf" illustrate the attached jpg.  I believe you need to execute steps 2 and 5 or 3 and 4 steps.  Any input on that?  Have a chat with our SQL resources and his first impressions are that you must perform steps 2, 3, 4 and 5 to set up the database for vCenter 5.

    Thanks for any input.

    steps 2-5 are just different methods on how to create permissions. They are all really with the same determination.

  • 11.1.2.1 install on questions of SQL Server 2008 R2

    Hi guys,.

    I install 11.1.2.1 on a windows 2008 Server SP1 by using SQL Server 2008 R2 as the back-end. I successfully all installed and set up the foundation components, deployed the webservices and tested I could connect both workspace and shared services.

    Then I advanced and set up BI, did the same tests and I could identify. Once I had that and installed essbase and planning and calculation Manager (not had of EPMA yet) I have the following text in newspapers for Foundation:

    com.hyperion.lcm.common.manager.ManagerException: registry/exception error occurred when retrieving properties properties of the registry migration. Nested exception is [MESSAGE - com.hyperion.lcm.common.manager.ManagerException: Shared Services product not found in the registry, FIRST CAUSE - com.hyperion.lcm.handler.LCMContext.loadProperties (135)].
    at com.hyperion.lcm.handler.LCMContext.loadProperties(LCMContext.java:147)
    at com.hyperion.lcm.handler.LCMContext.getProperties(LCMContext.java:74)
    at com.hyperion.cas.web.delegate.CASBusinessDelegate.getUserConfiguredFileSystemPath(CASBusinessDelegate.java:413)
    at com.hyperion.cas.web.CASContextListener.contextInitialized(CASContextListener.java:48)
    to weblogic.servlet.internal.EventsManager$ FireContextListenerAction.run (EventsManager.java:481)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
    to weblogic.application.internal.flow.ModuleStateDriver$ 3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
    to weblogic.application.internal.flow.ModuleStateDriver$ 3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
    to weblogic.application.internal.BaseDeployment$ 2.next(BaseDeployment.java:636)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
    to weblogic.management.deploy.internal.DeploymentAdapter$ 1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    to weblogic.management.deploy.internal.AppTransition$ 2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:261)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:220)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Error: The system of EMP security is not initialized properly


    Any help would be appreciated more by trying to understand why this is happening.

    See you soon
    Aaron

    . Oracle.instance

  • The question regarding SQL intervals

    I'm writing a piece of SQL for a report that will caclulate the total number of active sessions. The name of table I in draught is called "sessionhistory. This table has a field named "sessioninstantiationtime" for the start of the session and one called "sessiondestructiontime" for when it ends. I want counts the number of active sessions and calculate the bandwidth for each interval. Currently, my SQL works, but it only beginning resembles the session (sessioninstantiationtime). I need to change so that I count the sessions began, but have not yet finished. Here's the monetary SQL, can someone point me in the right direction? Any help is greatly appreciated...

    --

    SELECT
    To_char (sessioninstantiationtime, 'HH24') | ':' || To_char (Floor (TO_NUMBER (to_char (sessioninstantiationtime, 'MI')) / 15) * 15, "FM00") interval_value,.
    Count (case when to_char(sh.sessioninstantiationtime,'D') = '1', THEN '1' ELSE null END) as Sun_Streams,
    Sum (case when to_char(SH.sessioninstantiationtime,'D') = '1' Then sh.tsdownstreambw else 0 end) / 1000/1000 as Sun_Bandwidth,
    Count (case when to_char(sh.sessioninstantiationtime,'D') = '2', THEN '1' ELSE null END) as Mon_Streams,
    Sum (case when to_char(SH.sessioninstantiationtime,'D') = '2' Then sh.tsdownstreambw else 0 end) / 1000/1000 as Mon_Bandwidth,
    Count (case when to_char(sh.sessioninstantiationtime,'D') = '3', THEN '1' ELSE null END) as Tue_Streams,
    Sum (case when to_char(SH.sessioninstantiationtime,'D') = '3' Then sh.tsdownstreambw else 0 end) / 1000/1000 as Tue_Bandwidth,
    Count (case when to_char(sh.sessioninstantiationtime,'D') = '4', THEN '1' ELSE null END) as Wed_Streams,
    Sum (case when to_char(SH.sessioninstantiationtime,'D') = '4' Then sh.tsdownstreambw else 0 end) / 1000/1000 as Wed_Bandwidth,
    Count (case when to_char(sh.sessioninstantiationtime,'D') = '5', THEN '1' ELSE null END) as Thu_Streams,
    Sum (case when to_char(SH.sessioninstantiationtime,'D') = '5' Then sh.tsdownstreambw else 0 end) / 1000/1000 as Thu_Bandwidth,
    Count (case when to_char(sh.sessioninstantiationtime,'D') = '6', THEN '1' ELSE null END) as Fri_Streams,
    Sum (case when to_char(SH.sessioninstantiationtime,'D') = '6' Then sh.tsdownstreambw else 0 end) / 1000/1000 as Fri_Bandwidth,
    Count (case when to_char(sh.sessioninstantiationtime,'D') = '7', THEN '1' ELSE null END) as Sat_Streams,
    Sum (case when to_char(SH.sessioninstantiationtime,'D') = '7' Then sh.tsdownstreambw else 0 end) / 1000/1000 Sat_Bandwidth
    Of
    sessionHistory sh
    WHERE
    SH.sessioninstantiationtime BETWEEN TO_DATE('01-aug-09', 'dd-mon-yy') - 6 AND TO_DATE (1 August 09 ',' dd-mon-yy') + 1
    GROUP BY
    To_char (sessioninstantiationtime, 'HH24') | ':' || To_char (Floor (TO_NUMBER (to_char (sessioninstantiationtime, 'MI')) / 15) * 15, "FM00")
    ORDER BY
    To_char (sessioninstantiationtime, 'HH24') | ':' || To_char (Floor (TO_NUMBER (to_char (sessioninstantiationtime, 'MI')) / 15) * 15, "FM00");

    Hello

    If you want to specify the 7th day of the period of 7 days instead of 1 day and then subtract 6 in the two places where this setting is used.
    If you want a variable number of periods / hour instead of 4, then replace the three occurrences of the 'magic number' 4 with the number of periods per hour (60 /: period_length, where: length of the period is the number of minutes, for example 5, 15, 30 or 60.)

    VARIABLE  report_end_date     VARCHAR2 (20)
    EXEC      :report_end_date     := '03-Jul-2009';
    
    VARIABLE  period_length          NUMBER
    EXEC     :period_length          := 5;
    
    WITH     all_periods     AS
    (
         SELECT  TO_DATE (:report_end_date, 'DD-Mon-YYYY') + ( (LEVEL - 1)
                                                / (24 * 60 / :period_length)
                                           )
                                         - 6     AS period_start
         ,     TO_DATE (:report_end_date, 'DD-Mon-YYYY') + (  LEVEL
                                                / (24 * 60 / :period_length)
                                           )
                                         - 6     AS next_period_start
         FROM    dual
         CONNECT BY     LEVEL <= 7 * 24 * 60 / :period_length
    )
    SELECT     TO_CHAR (ap.period_start, 'HH24:MI')     AS period_start_time
    ,     COUNT    (CASE WHEN TO_CHAR (ap.period_start, 'Dy') = 'Fri' THEN sh.tsdownstreambw END)     AS fri_streams
    ,     NVL (SUM (CASE WHEN TO_CHAR (ap.period_start, 'Dy') = 'Fri' THEN sh.tsdownstreambw END), 0)
               / (1000 * 1000)                                             AS fri_bandwidth
    ,     COUNT (   CASE WHEN TO_CHAR (ap.period_start, 'Dy') = 'Sat' THEN sh.tsdownstreambw END)     AS sat_streams
    ,     NVL (SUM (CASE WHEN TO_CHAR (ap.period_start, 'Dy') = 'Sat' THEN sh.tsdownstreambw END), 0)
               / (1000 * 1000)                                             AS sat_bandwidth
    FROM           all_periods     ap
    LEFT OUTER JOIN  sessionhistory     sh     ON    sh.sessioninstantiationtime <  ap.next_period_start
                                      AND   sh.sessiondestructiontime   >= ap.period_start
    WHERE       TO_CHAR (ap.period_start, 'HH24:MI')     LIKE '01:__'     --     *****  FOR TESTING ONLY!  *****
    GROUP BY  TO_CHAR (ap.period_start, 'HH24:MI')
    ORDER BY  TO_CHAR (ap.period_start, 'HH24:MI')
    ;
    

    Note that the main request is completely unchanged.

    Out with the above parameters and the set of two rows of sample data:

    .           FRI_      FRI_       SAT_      SAT_
    PERIO    STREAMS BANDWIDTH    STREAMS BANDWIDTH
    ----- ---------- --------- ---------- ---------
    01:00          0      .000          0      .000
    01:05          0      .000          0      .000
    01:10          0      .000          0      .000
    01:15          0      .000          0      .000
    01:20          0      .000          0      .000
    01:25          0      .000          0      .000
    01:30          2     7.500          0      .000
    01:35          2     7.500          0      .000
    01:40          1     3.750          0      .000
    01:45          1     3.750          0      .000
    01:50          1     3.750          0      .000
    01:55          0      .000          0      .000
    

    The query will cover a period of 7 days consecutive ending with (and including): report_end_date.
    'Saturday' in this example means June 27, 6 days before Friday.

  • Question stupid yoga 900 Re: GPS

    The Y900 has a GPS chip?

    Nice day.

    Looking at the specifications of the PSREF list tab: http://psref.lenovo.com/Product/Lenovo_Yoga_900_13_inch I don't see any indication of the GPS function.

    Hope this helps to clarify.

    Kind regards.

Maybe you are looking for