Select with the DATE WHERE the...

Hi all!

I need to select with where condition on cirtain cust_date date (date) specifying columns say date01 = 25 August 10 'and time range somewhere between time01 = 7:15:00 ' and time2 = 9:30:00 ' ('HH24:MI:SS).
I have some test data and I saw still some trouble with my select particular regarinding of time slot.

Can someone tell me what will be the easiest way to do this, especially for the begiinner;

SELECT * FROM TABLE1 WHERE cust_date > to_date (August 25, 2010 7:15:00 ',' DD-MON-YY HH24:MI:SS')...

I just do to_date after >?


TX
Trent

Trento wrote:
Hi all!

I need to select with where condition on cirtain cust_date date (date) specifying columns say date01 = 25 August 10 'and time range somewhere between time01 = 7:15:00 ' and time2 = 9:30:00 ' ('HH24:MI:SS).
I have some test data and I saw still some trouble with my select particular regarinding of time slot.

Can someone tell me what will be the easiest way to do this, especially for the begiinner;

SELECT * FROM TABLE1 WHERE cust_date > to_date (August 25, 2010 7:15:00 ',' DD-MON-YY HH24:MI:SS')...

I just do to_date after >?

TX
Trent

http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions183.htm#SQLRF06132

Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
Connected as SYS

SQL> desc SH.SALES
Name          Type         Nullable Default Comments
------------- ------------ -------- ------- -------------------------------------------------------------------------------------------
PROD_ID       NUMBER                        FK to the products dimension table
CUST_ID       NUMBER                        FK to the customers dimension table
TIME_ID       DATE                          FK to the times dimension table
CHANNEL_ID    NUMBER                        FK to the channels dimension table
PROMO_ID      NUMBER                        promotion identifier, without FK constraint (intentionally) to show outer join optimization
QUANTITY_SOLD NUMBER(10,2)                  product quantity sold with the transaction
AMOUNT_SOLD   NUMBER(10,2)                  invoiced amount to the customer                                                             

SQL>
SQL> SELECT *
  2  FROM SH.SALES S
  3  WHERE S.TIME_ID >= to_date('19970102','YYYYMMDD')
  4  AND ROWNUM < 4
  5  ;

   PROD_ID    CUST_ID TIME_ID     CHANNEL_ID   PROMO_ID QUANTITY_SOLD  AMOUNT_SOLD
---------- ---------- ----------- ---------- ---------- ------------- ------------
        37        368 01/01/1998           2        999          1.00        63.57
        37       4687 01/01/1998           2        999          1.00        63.57
        37       8302 01/01/1998           2        999          1.00        63.57
SQL>  SELECT *
  2  FROM SH.SALES S
  3  WHERE S.TIME_ID >= to_date('19970102 10:12:00','YYYYMMDD HH24:MI:SS')
  4  AND S.TIME_ID < to_date('20000102 10:12:00','YYYYMMDD HH24:MI:SS')
  5  AND ROWNUM < 4
  6  ;

   PROD_ID    CUST_ID TIME_ID     CHANNEL_ID   PROMO_ID QUANTITY_SOLD  AMOUNT_SOLD
---------- ---------- ----------- ---------- ---------- ------------- ------------
        37        368 01/01/1998           2        999          1.00        63.57
        37       4687 01/01/1998           2        999          1.00        63.57
        37       8302 01/01/1998           2        999          1.00        63.57

SQL> 

SQL>
SQL>  SELECT *
  2  FROM SH.SALES S
  3  WHERE S.TIME_ID >= to_date('January 15, 1989, 11:00:00','Month dd, YYYY, HH:MI:SS',
  4       'NLS_DATE_LANGUAGE = American')
  5  AND S.TIME_ID < to_date('January 15, 2000, 11:00:00','Month dd, YYYY, HH:MI:SS',
  6       'NLS_DATE_LANGUAGE = American')
  7  AND ROWNUM < 4
  8  ;

   PROD_ID    CUST_ID TIME_ID     CHANNEL_ID   PROMO_ID QUANTITY_SOLD  AMOUNT_SOLD
---------- ---------- ----------- ---------- ---------- ------------- ------------
        37        368 01/01/1998           2        999          1.00        63.57
        37       4687 01/01/1998           2        999          1.00        63.57
        37       8302 01/01/1998           2        999          1.00        63.57

SQL>
SQL> SELECT *
  2  FROM SH.SALES S
  3  WHERE S.TIME_ID >= to_date('14-Feb-1998 11:00:00','DD-Mon-YYYY HH24:MI:SS',
  4       'NLS_DATE_LANGUAGE = American')
  5  AND S.TIME_ID < to_date('17-Mar-2000 11:00:00','DD-Mon-YYYY HH24:MI:SS',
  6       'NLS_DATE_LANGUAGE = American')
  7  AND ROWNUM < 4
  8  ;

   PROD_ID    CUST_ID TIME_ID     CHANNEL_ID   PROMO_ID QUANTITY_SOLD  AMOUNT_SOLD
---------- ---------- ----------- ---------- ---------- ------------- ------------
        36       2168 15/02/1998           3        999          1.00        51.29
        36       7237 15/02/1998           3        999          1.00        51.29
        36       7678 15/02/1998           3        999          1.00        51.29

SQL>  

Tags: Database

Similar Questions

  • White on white selection with the magic wand of refining

    I'm trying to remove the background of a picture of BW - one model posing in front of a white background.

    Select with the magic wand works fine except on the area where the light on the model wears the white skin. When I choose, I get the hand and the lower part of the arm (see below) but miss the box top, completely white. I tried all kinds of settings and also tried to increase the contrast with a brightness/contrast layer, but nothing I I understand allows me to keep the arm and remove the bottom with the arm.  FWIW, the image cannot be redone.

    How can I do? Thanks for any help.

    EdB

    fist copy.jpg

    Learn how masking... Also in white when mixed in a layer with the blending mode multiply does not change.  So, if you add a new layer on top of your image and set its blending mode to multiply. You will see your arm starts to show through. Add a maske layer to this layer and paint with black to show the lower arm of the layer by hiding the top layer on the arm area.

  • Can we synchronize permission selected with the settings of operating system Notifications BB10 for our Application.

    Steps to follow:
    BB10 device--> settings--> Notifications--> Applications--> [name of your application]--> all alerts [Toggle button]

    I have an obligation to check whether or not 'All alerts' is allowed through settings when the application is running. To check if we can synchronize permission selected with the settings of operating system Notifications BB10 for my application. How to get javascript code if alerts permission is on / off, while the application is running.

    I tried adding the blackberry.system function and tried to hasPermission (blackberry.push) also, I can't determine if permission is allow / prohibit... Please suggest how to get that.

    I don't see a WebWorks API for this. If I expected to be anywhere, it's here:
    https://developer.BlackBerry.com/HTML5/APIs/beta/BlackBerry.notification.html#jbo1385148829097

    But it seems that this API has not been fully implemented; It may be useful to connect a developer Issue Tracker JIRA to get this feature added.

    At the same time, there is this API of Cascades that looks like what you're looking for:
    https://developer.BlackBerry.com/native/reference/Cascades/bb__platform__notificationapplicationsett...

    Write an extension for this feature should allow you to access this feature:
    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/template

    At the same time, a colleague is currently working on an extension that should open many features of Qt, and I think that the API above should be accessible through this extension. He must be released over the next week or two, so you can wait for that as well.

    EDIT: On this last point, see this extension which provides a mechanism for attaching in the majority of the Qt APIs.

    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/QtBridge

  • Unable to set keyframes in the audio clip selected with the pen tool - can no longer see the volume control line after developing the clip. What could be the problem? This seems to be the problem on any project that I opened.

    Cannot set keyframes in the audio clip selected with the pen tool - cannot see even the line volume control more to set keyframes on having developed the clip. What could be the problem?  I use the first CC pro @.

    You can use the Ctrl key and then click with the regular selection tool, clicking with ctrl will make a new keyframe. in this way, have no need for the tools. CTRL has other great shortcuts that will stop you having to spend retouching pads tools too.

    If the automation keyframe line is missing, you can switch on and off in the menu sequence.

  • The Central handle on the rectangle isn't gone when I select with the black arrow (v) tool. See the bounding box and the edges is both. Dd intermediate anchor to go?

    The Central handle on the rectangle isn't gone when I select with the black arrow (v) tool. See the bounding box and the edges is both. Dd intermediate anchor to go?

    haggyabeken,

    I'm afraid that you have come across the Rectangle Live bug, which is limited to MAC versions starting from 10.7 and 10.8, but not 10.9 (Mavericks), see this thread linked below.

    https://forums.Adobe.com/thread/1595973

    Thus, a switch for the Mavericks with a reinstall might be the way to solve it here and now.

    To get around it, in each case, it is possible to develop direct Rectangles to get the normal old shaped rectangles or Pathfinder > unit, or use the scale tool.

    A more permanent way round that is to create normal old shaped rectangles, after running the free script created by Pawel, see this thread with download link:

    https://forums.Adobe.com/thread/1587587

  • SELECT with the combination of two columns query

    I need the research to write a nested select statement that would achieve the following.
    Support I have a table as follows
    TestTable
    Name: Age: country
    Test1: 10: USA
    Test2: 11: us.
    Test3: 12: us.
    Test4: 11: Canada
    Test5: 12: Canada

    Now, I want to select in the table above gives the following information.
    Get all the names of people who do not belong to this combination (10:USA, 11:Canada, 12:Canada). The list can be huge.
    The result should be
    Test1:10:USA
    Test1:12:USA

    If it was a combination, I can write
    Select * from TestTable
    the age where <>10 and <>country Canada

    Also, I can also do
    Select * from TestTable
    the age where NOT IN (10,11) and country NOT IN (USA, COUNTRY)
    But I do have that he would give me a correct result.

    sush_msn wrote:
    Is there a way I can move the age and the country as a list on the query?

    You asked the right question.

    Three things you need to know:

    (1) your test data cover all combinations. This is the most comprehensive test data:

    create table test_table1 as
    WITH AGES AS (
      SELECT LEVEL+10 AGE FROM DUAL CONNECT BY LEVEL <= 3
    ), COUNTRIES AS (
      SELECT 'USA' COUNTRY FROM DUAL
      UNION ALL
      SELECT 'CANADA' COUNTRY FROM DUAL
    )
    SELECT 'Test' || ROWNUM NAME, AGE, COUNTRY FROM AGES, COUNTRIES;
    
    NAME                                                AGE COUNTRY
    -------------------------------------------- ---------- -------
    Test1                                                11 USA
    Test2                                                11 CANADA
    Test3                                                12 USA
    Test4                                                12 CANADA
    Test5                                                13 USA
    Test6                                                13 CANADA
    

    (2) now, here's the answer to your question. You can go back two or more values in an expression by putting parentheses around them.

    SELECT * FROM TEST_TABLE1
    WHERE (AGE, COUNTRY) NOT IN (
      (11, 'USA'),
      (12, 'CANADA')
    );
    
    NAME                                                AGE COUNTRY
    -------------------------------------------- ---------- -------
    Test2                                                11 CANADA
    Test3                                                12 USA
    Test5                                                13 USA
    Test6                                                13 CANADA
    

    That's what made the Etbin above, but he used a select instead of a list of values.

    (3) can AGE or COUNTRY ever be NULL? You want to return the records that have NULL values in them? If so, you must use NOT EXISTS instead of NO po WARNING: Etbin code needs a bit of change: "where (age, country) = (t.age, t.country)" should be "where (age, country) = ((t.age, t.country)) '. You must always additional brackets on the right side.

  • SELECT with the matter in that statement based on the procedure returning a Boolean

    Hi all

    I try to build a select statement with a case where the condition.
    SELECT COL_ID, COL_TITLE, COL_COMMENT,
               ( CASE WHEN COL_IT = :USER_ID THEN 'Y' 
                           WHEN COL_USER = :USER_ID THEN 'Y'
                           WHEN REGEXP_LIKE(COL_IT_ADD, '(^|:)(' || :USER_ID || ')(:|$)') THEN 'Y'
                           ELSE 'N' END ) MY_COL,
    FROM   MY_TABLE
    WHERE  ( CASE WHEN MY_PACKAGE.AUTHORIZE('IT') = TRUE THEN 'Y'
                           WHEN MY_PACKAGE.AUTHORIZE('IT') = FALSE AND COL_USER = :USER_ID THEN 'Y'
                           WHEN MY_PACKAGE.AUTHORIZE('IT') = TRUE AND  REGEXP_LIKE(COL_IT_ADD, '(^|:)(' || :USER_ID || ')(:|$)') THEN 'Y'
                           ELSE   'N' END ) = 'Y'
    The case for the calculation of the value of the column works fine. Run this query without the where also works in condition.
    But in the condition, I get the following error: SQL error: ORA-00920: invalid relational operator 00920. 00000 - "invalid relational operator.
    The MY_PACKAGE procedure. AUTHORIZED (pValue) returns a Boolean value. Is it possible to use a case statement in the WHERE condition to calculate a value and check for this? If not, is there another way to do something like this in a query?

    Thanks for your help
    Chrissy

    The Boolean data type is unknown in SQL... you cannot use functions that return Boolean values in SQL.

    You can add a function overloaded in the package which returns a 'Y' or a 1, or something else that is a data type in SQL.

  • LabVIEW 2009 SP1 crashes when moving large selection with the arrow key

    If I select a lot (10 or 15) diagram components and try to move some distance with the arrow button, I'm often a program crash.  Because a reduced number of components seems to hang after a longer distance traveled, it looks like some sort of buffer overflow error.  I don't see this problem when you use the mouse to move selections.

    I checked to make sure I have the latest version of the video driver for my NVIDIA Quatro FX570.  I also tried to work with no hardware acceleration and no handset, written.  What happens on Windows XP SP3 with all current updates.

    It became so bad that I have to do a save as every fifteen minutes to avoid losing data.

    Why not use my mouse for all movements?  Because it is not as specific and not so easy to limit to only one dimension of the movement.   My hand is not as stable as it once was.

    I'm hoping someone will have a suggestion that will clear up this problem.

    As I have indicated, I had the same problem with 8.5 and just DID a new install of Labview 2009.

    Since it is possible that my three monitors configuration, which of course requires more memory video, may be at the origin of the problem, I am satisfied with workaround by dragging the objects closer to their final destination and then using the arrow keys.

    Three monitors are ideal for the front, block and help/Internet/probe damaged.  When I got to work in the field with a single monitor, I felt severely handicapped.

    You can consider the issue closed.

    Thank you for trying to reproduce the failure.

  • How to manage the selection with the box in a table

    Hello


    JDev 11.1.2.4

    I have a table with an attribute of EO/VO, transitional to manage the selection. This attribute is displayed as a check box. The user makes a selection by clicking on the checkbox. Then, the user clicks on a button that displays a pop-up window. Inside of this pop-up window, that user can create, insert, delete, or update values in a table based on an other EO/VO.

    When the user clicks OK, the pop-up window is closed, then the data is committed.

    When the user clicks Cancel, the popup is closed and the changed data are ignored. To remove the data, I call a Rollback. It works fine, but all the transitory values are lost which is correct because of the discount after the cancellation.

    It's a problem because the user must be able to open the pop-up window several times with the same selection. This means that the restoration is not appropriate in this case.

    How to ignore data edited inside the pop-up window and keep the selection?

    Thank you

    You can try to put the popup in his own taskflow and define a backup point before entering the taskflow. When the user cancel the editing restore you to previous backup. This should dispel the changes.

    Or you save the selected rowkeys, call rollback and backward selection later.

    Timo

  • What happened to the ability to hide the "mobile dash" (CTRL/CMD (H) in Photoshop?  I can't see the edges of my selection with the mobile dotted lines in the way!

    I used Photoshop since version 2.5 when it came to 16 disks.  In all versions I've bought over the years (many) up to CS3, I've always been able to use CTRL + H (Windows) or CMD + H (Mac) to hide the "mobile dash" edge of the selection.  This is extremely useful when doing all sorts of adjustments where the outline of the selection must be considered while "fiddling with the buttons" (so to speak).  Without being able to hide the limits of selection ("mobile dash"), I often have to get a better idea, cancel the selection, get disgusted that the edge is not what I want, then have to cancel, select new, try again... over and over again.   It is a SIMPLE feature, but the lack of it, driving me crazy.  HELP, I tried, but it doesn't have the height of the promise.  If there is a way to hide the dotted moving line, where is the menu item, and what the shortcut?

    You can assign Ctrl/Cmd-H to hide the edges of the selection (Edit > keyboard shortcuts) only, if you want to hide everything, but you will be notified if any other function has the shortcut.

  • "WARNING: no pixel selected" with the magic wand

    Details:

    Product: Adobe Photoshop CS5 64-bit

    OS: Windows 7 64-bit

    I'm working on the application of a coating that is textured to a field of hexagons, but not for their "Grout", i.e. the border thickness between each hexagonal "mosaic". I made a selection of the "Grout" and then reversed so that now my hexes were selected, make a new layer filled with black, and then using the magic wand tool, I deselected about 2/3 of the selections in Allen. Apply noise, motion blur, makes a fine metal grain. Invert the selection, remove the excess black, then reverse and save the selection. Define as overlay, super good. Then layer, load my selection of the Hexagon, 1/3 of the responsible for the selection of France that I've done before (so I do not apply two textures on any of a hexagon) and I get about 2/3 of the hexagons selected. New layer, fill it with black, just like the last time. Except that... when I use my magic wand to deselect, I get ' WARNING: No. Pixels were selected "and I lose the entire selection. Can I deselect using square or the quick selector, but not the magic wand. Now I well recorded and could recreate so no real work is lost, but it is easier deselect each Hexagon bit (there a LOT of them) with the magic wand of monstroustly. Why this suddenly is upward?

    Thank you for your time,

    Charles DiGiovanna

    How is the box to sample all layers [] at the top of the main window of Photoshop?

    If it is not checked, the wand will only use the data on the layer that is currently selected.

    -Christmas

  • Select with the javascript function

    I need to create a purchase order that allows to calculate the cost of printing using one-sided or two-sided. My problem is that this code can use only the cost of single_side in the function. The function must use two side cost if "DUP" checkbox is disabled. What I read javascript does not provide a way to access the selection list as if it were a table. (Where I can identify what dimension of the table I would use). Is there another way to do this?

    < script type = "text/javascript" >
    total() function
    {
    var Field1 = document.getElementById("DUP").value;
    var Field2 = document.getElementById("COPIES").value;
    var field3 = document.getElementById("ORIG").value;
    Field4 var = document.form2.paperlist.value;
    sphere5 var = document.form2.paperlist.value;
    If (Field1! = "no")
    document.getElementById("mytotal").value = parseInt (field2) *.
    parseInt (field3) / 2 * parseFloat (field4);

    on the other
    document.getElementById("mytotal").value = parseInt (field2) *.
    parseInt (field3) * parseFloat (field5);

    }
    < /script >

    Select name = "paperlist" id = "paperlist" onchange = "total ()" > "
    < cfoutput query = "paperlist" >
    < option value = "#paperlist.single_side # #paperlist.two_side #" > #paperlist.descr #, #paperlist.single_side #, #paperlist.two_side # < / option >
    < / cfoutput >
    < / select >

    < input type = "checkbox" name = "DUP" id = "DUP" onchange = "total ()" accesskey = "3" tabindex = "3" > "
    < input type = "text" name = "COPIES" id = "COPIES" onchange = "total ()" accesskey = "1" tabindex = "1" default size "0" = "10" = > "
    < input type = "text" name = "ORIG" id = "ORIG" onchange = "total ()" size = "10" accesskey = "2" tabindex = "2" default = "0" / > "
    < input type = "text" name = "mytotal" id = "mytotal" readonly = "true" size = "10" / >
    < input type = "submit" name = "submit" value = "Submit" / >

    I guess you want to get the "selected" option from the selection list?

    You call the js function in the onchange event of the select list just pass it as a parameter

    Select name = "paperlist" id = "paperlist" onchange = "total (this.selectedIndex.value)" > "

    total function (slectedValue)

    or

    document. FORMNAME. SELECTLISTNAME.options [document. FORMNAME. Alue SELECTLISTNAME.selectedIndex] .v

    This will give you the value selected from the list of selection, simply replace "FORMNAME" with the name of your form and your 'SELECTLIST' with the name of your selection list

    Ken

    Edit:
    Should have to read it again, yes you can do it.

    It is not clear which character you have between 2 values in the value attribute of the selection list, but I would suggest a comma, no spaces

    Then

    field5Array = field5.split(',');

    This will then give you the picture that you want with
    field5Array [0] equal to single sided
    and
    field5Array [1] equal to double-sided

  • Excel cells don't no shading when non-adjacent cells are selected with the Ctrl key

    When cells not adjacent are selected in any spreadsheet Excel 2007 that normal cell shading shows which cells are considered for avg, sum count etc works in the lower tray of Excel.  Unexpectedly when I now select cells not adjacent no shading appears and I have no idea of cells that have been selected.  Is this some sort of setting usless that I inadvertently threw it or is this a real Excel error?

    http://www.Microsoft.com/Office/Community/en-us/flyoutoverview.mspx

    Above is the link with the Office discussion groups.

    http://www.Microsoft.com/Office/Community/en-us/default.mspx?DG=Microsoft.public.Excel.misc&lang=en&CR=us

    And Excel Newsgroup.

    There are different groups of discussion Excel listed in the main link.

    Hope that helps.

    See you soon.

    Mick Murphy - Microsoft partner

  • Lasso tool polygon binding angles trying to add to the selection with the SHIFT key

    Since upgrading (downgrading?) of Photoshop CS6 Extended Photoshop CC I have a problem with the lasso tool of polygon limited at certain angles when you try to add to a selection.

    Here's the scenario, I select a color background with the magic wand tool, then I would like to add a few things to the selection, so I click on the polygon lasso tool and hold the SHIFT key to add to the playlist and then start to use the polygon lasso tool... often very randomly the polygon lasso tool will limit his movements to a 90 degree angle Sometimes something that seems like an angle of 30 degrees and sometimes he'll do any.

    I'm doing something wrong or is this a bug?

    The SHIFT key has two functions in the creation of a selection.  The first is as you know to add to any selection using another selection tool.  The second is forced to angles in drawing and selection, but also rotation tools.  So for your example, you have to hold down the SHIFT key when you click on to add to your selection using the polygon lasso tool, but after making the first click with the tool, Photoshop knows that you want to add to the selection.  So do not hold the SHIFT key after the first click, otherwise Photoshop assumes that you also want to compel the angles drawing of your choice.  (Unless that's what you really want to)

  • Removal of the track selected with the Lasso (Q) tool

    I am running the tool lasso through some ovals (diagram below), and I want to just delete these forms that I run the lasso tool, however, seems Lasso to select anything within its space tent 'bridge '.

    (I understand his choice of anchors in this form). Is it possible to choose the oval shapes only (fast) it seems that I must now select them individually (like a bird with crumbs).

    This is the direction of drag lasso

    lasso.jpg

    This is the result of the selection of this movement of lasso.

    lasso2.jpg

    I use illustrator CS6 Version 16

    BlueFire,

    I fear this is how it works (imagine your movement (part of) the lasso loop).

    For your purpose, you can better off ShiftClicking/ShiftClickDragging with the selection direct tool, hold Alt/Option If you want to catch all paths.

Maybe you are looking for

  • Why can't I choose the colors for tabs?

    28 Firefox is faster and improved - except that the tabs unread pages are of the same color as the background and the toolbar. Please revert to the previous version or let me PICK colors.

  • Can I upgrade my processor?

    I have a laptop Compaq Presario C700 and I wanted to know if its possible to upgrade my processor.My current processor is «Intel (r) Pentium (r) Dual CPU T2310 @ 1.46 GHz» (Intel (r) Pentium (r) Dual CPU T2310 @ 1.46 GHz) I want to switch to a faster

  • Scanning with a 7520 Photosmart

    Is it possible to scan a multi-page document in one e-mail with the automatic document feeder?

  • Sansa Clip screen help

    I have a sansa clip 2 GB V1, and everything was fine until I updated the firmware yesterday. When I press on what the screen has a yellow band on the top and light blue on the rest of the screen. I tried to reset it and re format. Someone knows what'

  • HP Pavilion DV7t-6000 - product number: XW899AV - replacement Fan

    Hello I need to replace my fan.  Looking at the manual, I see two differnet options to determine what I need spare part, but am not sure what graphics subsystem I.  I want to be sure that I have order the right part. Please let me know if you need ad