between the clause of

I have a question where I get the data from a range of dates

Select * from test_table where test_date between date1 and date2

The query will give record set between date1 and date2.

Now say date2 is null, in this case, I need to get all the records with test_date > = date1 as there is no limit on the date2.

I don't want to use dynamic SQL to do this, now how it can be done?

AB

Hi, Ab,

Here's one way:

Select *.

from test_table

where test_date between date1

and NVL (date2

test_date

)

;

and another:

Select *.

from test_table

where test_date > = date1

and (test_date<=>

Date2 IS NULL OR

)

;

Tags: Database

Similar Questions

  • between the clause of sql query?

    Hi all

    After sql query using a report.
    ------------------------------------------------

    Select trunc (m.spc_doc_date) prod_date, sum (nvl(d.req_qty,0)) order_qty, sum (nvl(d.spc_item_qty,0)) prod_qty
    of spc_ppc_daily_m m, spc_ppc_daily_d d
    where m.spc_doc_ # in (select spc_doc_ # to spc_ppc_daily_m)
    - and d.blce_qty > 0
    and m.spc_locn_code =: locn_code
    and m.spc_doc_date between: TO_date and: FROM_date
    and m.spc_locn_code = d.spc_locn_code
    and m.spc_doc_ #= d.spc_doc_ #.
    and (m.obu =: obu OR: OLGA IS NULL)
    and (m.customer =: customer OR: CUSTOMER IS NULL)
    Trunc Group (m.spc_doc_date)
    order of trunc (m.spc_doc_date)

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

    "When I use to_date = 22 February 2012 ' from_date = February 22, 2012"
    There is no pick up. (acually documents are there on February 22, 2012)

    "When I use to_date = 22 February 2012 ' from_date = February 23, 2012"
    now shows data of February 22, 2012.

    I have replace between it of > = & < =, same result two cases respectively.

    Why?

    Thank you
    Yoann

    date you hours minutes and seconds
    then

    use
    trunc (m.spc_doc_date)

    or to: from_date in the parameter after form convert to February 23, 2012 23:59:59 '

  • Packets exported 11 g, but when I import on 12 c error of ' the target 11.2.0.3.0 database is an older version of the 12.1.0.1.0 source. Thus the storage clause is ignored to avoid problems of incompatibility between the versions. »

    Packets exported 11 g, but when I import on 12 c having error of ' The 11.2.0.3.0 target database is an older version of the 12.1.0.1.0 source. Thus the storage clause is ignored to avoid problems of incompatibility between the versions. »

    When I export only 1 package and then import, then I have no error and imported successfully, but when I do bulk above mention error comes.


    How can you make with the help of the SQL Developer or query?


    Kind regards.

    The problem is solved since
    Impdp iris/tpstps@PCMS full = Y dumpfile INCLUDE PACKAGE VERSION = 11.2.0.3.0 = packagespcmsTWO.dmp =
    query

  • Updated between the values

    Hello

    Could someone help me with a very trivial problem.

    I have after the update clause, but it gives the error ORA-01427. Seems that it is between the two problem. How should I change what he begins to work?

    Update sales_in

    the value of sale = (select a.sales in the sales_out one

    where a.sales_year_month between 201501 and 201505);

    Update sales_in I

    the value of sale = (select a.sales in the sales_out one

    where a.sales_year_month = i.sales_year_month

    )

    where i.sales_year_month between 201501 and 201505;

  • I want to know the differences between the conditions of subscription and use of Photoshop for photographers of the usual subscription?

    Nice day! I want to know the differences between the conditions of subscription and use of Photoshop for photographers of the usual subscription? And if I can buy then and for how Adobe Illustrator? What will be the beta of the Adobe XD for Windows? Thank you!

    If you ask what is the difference between photographic subscription and the subscription of stand-alone application, then the answer is both are essentially the same except for two ways. The photographic edition comes with Adobe Lightroom and 2 GB of cloud storage. The stand-alone Photoshop version comes on its own, but with 20 GB of cloud storage and is two times more expensive. If the 18 GB of cloud storage is an additional value, I would say probably no - put the money that you save on an external hard drive in place. The photographic edition was initially a temporary special offer caused a suggestion from one of the co-creators of Photoshop, but turned out to be very popular with fans, private and business and so we have a permanent plan to subscribe to Photoshop. There is no plan equivalent to Illustrator and who is available at a single price. With the subscription model, you can cancel at any time, but the contract is 1 year, if you cancel at the beginning there is a penalty clause which will ask you to pay extra this tax applies only if you pay your monthly subscription every year.

    You don't say where in the world you are, but the link below shows the available plans. There is a drop down box that allows the conversion in different currencies.

    Pricing plans and creative Cloud membership | Adobe Creative Cloud

    Hope that helps.

    Terri

  • What is the preferred means of data transmission as a type of record between the nested table of pl/sql program or an associative array

    What is the preferred means of data transmission in the associative array of the nested table record vs

    Choose between Nested Tables and associative arrays

    The two nested tables and associative arrays (formerly index - by tables) use similar index notation, but they have different characteristics when it comes to persistence and ease of passing parameters.

    Nested tables can be stored in a column of data, but can of associative arrays. Nested tables can simplify the SQL operations where you would normally join a single-column table with a larger table.

    Associative arrays are appropriate for relatively small lookup tables where the collection can be constructed in memory whenever a procedure is called or a package is initialized. They are good for the collection of the information volume is unknown beforehand, because there is no fixed limit on their size. Their index values are more flexible, as associative array indices can be negative, can be no sequential and can use values of string instead of numbers.

    PL/SQL automatically converts between the bays of the host and the associative arrays that use values of digital keys. The most effective way to move the collections to and from the database server is to implement data values in associative arrays, and then use these associative arrays with erections in bulk (the FORALL statement or BULK COLLECT clause).

    With the help of documents and Collections of PL/SQL

    Read this:

    How to pass the record set as a parameter of the procedure.

    https://community.Oracle.com/thread/2375173?TSTART=0

  • Select the query with the level line list where the clause

    Hi all

    I am creating a tabular presentation based on a SQL query that has a list of selection based on a query with a where clause clause that refers to a column in the original SQL query.

    The situation is, I have a table that stores the client_id, source_id, and build_id, lets call it client_source. I have a second table, build_source, containing source_id and build_id, one to many relations between the two (1 source_id could have build_id 1-7).

    Using a tabular presentation, I want to select the correspondent build_id to use in client_source, but the selection list should contain only the build_id for this particular source_id of lines.

    Here is an example of the SQL source of tabular presentation;

    Select
    s.ROWID,
    s.CLIENT_ID,
    s.SOURCE_ID,
    APEX_ITEM. SELECT_LIST_FROM_QUERY (1, s.BUILD_ID,)
    "Select display b.build_id, b.build_id return.
    b build_source where b.source_id = s.SOURCE_ID ') lst
    of s client_source

    what I want to achieve, it's as source_id "BOLD" match fields. When the query is built this way, I get an error of "invalid identifier" Oracle on s.SOURCE_ID during execution.

    Is there some special tags to be used to refer to the external column? I must be missing something because this looks like a pretty mundane problem.

    I am running on 4.1.0.00.32, on an Oracle 10 g release 10.2.0.4.0 Server Express request.


    I look forward to useful responses!


    See you soon,.
    Jason

    Published by: 1005131 on May 9, 2013 19:02

    Your selection by query list receives a static SQL. That SQL can't "see" the value of your s.source_id.
    But it would work like this:
    where b.source_id = ' | s.SOURCE_ID)

    You would be the value for the SQL concatenation. It is not ideal, but it will work.

    Jorge

  • Seen the clause and order by date

    Hello
    I have a query in which I use the having clause (have rownum between 1 and 10) and you want to order by date, but the result sorts data correctly. The result is not sorted by date.
    The query looks like this

    Select rownum, MTT_HANDHELD_TRANS.hh_RECEIPT, MTT_HANDHELD_TRANS.hh_lic_number and MTT_TOLL_PLAZAS. Acronym of TP_ABBREVIATION AS,
    MTT_HANDHELD_TRANS. HH_PLAZA AS, MTT_HANDHELD_TRANS PLAZA. AS Lane, MTT_HANDHELD_TRANS HH_LANE. HH_TRX_DATE as TrxDate,
    TO_CHAR (MTT_HANDHELD_TRANS. HH_TRX_DATE, 'hh24:mi:ss') AS TrxTime, MTT_HANDHELD_TRANS. HH_VEHICLE_TYPE, MTT_HANDHELD_TRANS. HH_AXLES,
    get_tolltobecollected (hh_plaza, hh_vehicle_type, hh_axles, hh_trx_date, hh_tow_vehicle_type, hh_tow_axles) as TollCollect,
    Decode (NVL(hh_serfee_waived,0), 0, 'No', 'Yes') as the exclusions, hh_waiver_comments, hh_lic_state, hh_monitor, hh_defcashkeyno,.
    As paid NVL(hh_paid,0) FROM MTT_HANDHELD_TRANS, MTT_TOLL_PLAZAS WHERE HH_PLAZA is MTT_TOLL_PLAZAS. TP_PLAZA and hh_remark = 1
    and (trunc (hh_trx_date) between to_date (' 05/01/2010 ',' mm/dd/yyyy') and to_date (' 05/03/2010 ',' mm/dd/yyyy'))
    Group of rownum, hh_receipt, hh_lic_number, tp_abbreviation, hh_plaza, hh_lane, hh_trx_date, hh_vehicle_type,
    hh_axles, hh_serfee_waived, hh_waiver_comments, hh_lic_state, hh_monitor, hh_tow_vehicle_type, hh_tow_axles,
    hh_defcashkeyno, hh_paid have rownum between 1 and 10
    order of hh_trx_date

    Rather than display the data with the date 01/05/2010 first of all, it shows 2010-05-02 and data with 01/05/2010 comes from somewhere between the other dates, I think that is data are themselves mixed up. Is there a way can I fix?

    Thank you.
  • Four fingers sliding between the desktops?

    What happened to the ability of sweeping four fingers between desktop computers (Sierra)?  Is it gone or just hidden somewhere?  I looked in the trackpad system preferences and I see is the ability to scan to four fingers between apps fullscreen.  I used four-finger drag to move between desktops countless times every day, I hope that this feature did not go away or I'll be a frustrated Mac head.  If it disappeared (shouldn't be), how the hell move us between workstations?

    OK, I stumbled accidentally on a solution.  I have reset my desktop image and four fingers sliding between the offices came back.  Phew!

  • I was wondering what the difference was between the powerbeats 2 and the powerbeats 3. What is this new "chip" in the powerbeats 3?

    I was wondering what the difference was between the powerbeats 2 and the powerbeats 3. What is this new "chip" in the powerbeats 3?

    Hello

    Main differences are:

    • Up to 12 hours of battery life with Powerbeats3, which use chips to W1 Apple energy-efficient (vs. up to 6 hours of battery life with Powerbeats2).
    • A quick charge of 5 minutes for a typical use of an hour (vs 15 minutes to load).
    • Improved ergonomic design.

    More information:

    http://www.Apple.com/shop/product/MNN02LL/A/powerbeats3-wireless-earphones-shock-Jaune

    http://www.beatsbydre.com/earphones/browse-earphones/wireless-earphones/ML8V2.ht ml

  • synchronization between the iphone and windows 7

    Can I synchronize excel and word between iphone and windows 7?  How?  CAN I get excel and word or compatible programs (aps) on iphone?  Also - I have an old version of MS Outlook (2002, 10.6 V, SP3) I want to be able to sync with the calendar on the iphone.  What can I and how?

    Also - I do not trust "the cloud."  How can I synchronize and transfer stuff between the iphone and my computer (win 7) without putting them on the cloud?

    Don't have an iphone yet, this will be my first smart phone.  Being able to use the above programs and stay out of the cloud are my priorities.

    Thank you

    Word and Excel:

    https://iTunes.Apple.com/us/app/Microsoft-Excel/id586683407?Mt=8

    https://iTunes.Apple.com/us/app/Microsoft-Word/id586447913?Mt=8

    Yes, you can sync if you store your documents in the cloud, but you do not trust so the answer is, you cannot them synchronize the.

    lar136 wrote:

    Don't have an iphone yet, this will be my first smart phone.  Be able to use the above programs and stay out of the cloud is my priorities.

    Don't get an iPhone. I think the Android device is a better solution for you.

  • My speed has decreased between the router and the modem is not working properly, what can I do to increase the download speed with my Time Capsule 802.11n

    My speed has decreased between the router and the modem is not working properly, what can I do to increase the download speed with my Time Capsule 802.11n

    A variety of phenomena can affect the performance of its wireless network. You may be able to mitigate some negative effects.

    Solutions to any factors that may have an impact on your wireless network, read use the Diagnostics wireless for you help to solve the problems of Wi-Fi on your Mac - Apple Support.

  • Closing tabs creates a gap between the tabs.

    Hello. I'm trying to customize the look of FF by editing the userChrome.css.

    I almost had, but there is a problem that I can't solve.

    After closing a tab with a higher number 40, there are still vacant place between the tabs to the left. See the image.

    That's what I've added to userChrome.css. Please help me solve the problem.

      DISABLE FIREFOX DEFAULT BACKGROUND  
    
    #TabsToolbar:not(:-moz-lwtheme)::after {
    	display: none;
    }
    
    /*===============================================
      INACTIVE TABS
      ===============================================*/
    #TabsToolbar .tabbrowser-tab {
    	text-align: left!important;
    	-moz-border-top-colors: none !important;
    	-moz-border-left-colors: none !important;
    	-moz-border-right-colors: none !important;
    	-moz-border-bottom-colors: none !important;
    	background: #BAB9A8 !important;
    	border-top: 1px solid #4F4E47!important;
    	border-bottom: 1px solid #4F4E47!important;
    	border-left: 1px solid #4F4E47!important;
    	border-right: 1px solid #4F4E47!important;
    	border-radius: 3px 3px 0px 0px !important;
    	color: #000000 !important;
    	/*margin: 0px 3px 0px 2px !important;*/
    	font-family: "Ubuntu",Helvetica,Arial,sans-serif;
    	font-size: 11px;
            max-width: 43px !important;
            min-width: 40px !important;
    }
    
    /*===============================================
      ACTIVE TABS
      ===============================================*/
    #TabsToolbar .tabbrowser-tab[selected] {
    	font-weight: normal !important;
    	border-top: 1px solid #000!important;
    	border-left: 1px solid #000!important;
    	border-right: 1px solid #000!important;
    	border-radius: 3px 3px 0px 0px !important;
    	background: #F0E68C !important;
    	color: #000000 !important;
    }
    
    /*===============================================
      DISABLE AUSTRALIS TAB
      ===============================================*/
    #TabsToolbar .tab-background {
    	margin: 0;
    	background: transparent;
    }
    
    #TabsToolbar .tab-background-start,  #TabsToolbar .tab-background-end {
    	display: none !important;
    }
    
    #TabsToolbar .tab-background-middle {
    	background: transparent !important;
    }
    
    #TabsToolbar .tabbrowser-tab:after,  #TabsToolbar .tabbrowser-tab:before {
    	display: none !important;
    }
    

    Maybe try the Restorer Classic theme to see if that works and review the CSS code that uses this extension.
    The style of the tab bar is quite complicated and also may not be stable across releases.

  • In preferences, search option is missing between the general and the content.

    I use Firefox 40.0.3 on OSX and I tried to set the search parameters. When I go into Preferences, I don't see the search catgergory. If I remember correctly there used to be between the general and the content, but it just disappeared. I was wondering if there is a way to recover or if these options have been moved to another location in the new version.

    I restarted Firefox in safe mode to disable all addons. It is not yet here.

    You have disabled browser.search.showOneOffButtons [set this pref to false] in Subject: config?
    Enter about: config in the URL bar and press ENTER. then use the search box at top.

    Options > Search "tab" disappears when this pref is toggled to false. Search preferences back to the old system where the 'controls' are in the search bar - manage search... engines such as those used before Firefox 34.

  • Not switching devices not between the bases of the airport?

    Hi all!

    I write because that through my research, I have not found quite the answer.

    I have 5 Airport extreme (AP) in my house. One of them is connected to the ISP (this also ISP DHCP box) box. All of them are set up to extend wifi as a long string.

    The problem I have is that I can't connect the AP via ethernet, creating a network of "roving". Is it possible to approach but?

    Because currently my devices switch base station that I propose. If I was connected to the AP1 and I'm still in the range of it, I don't connect at the base next to me (which has a faster speed of the internet) and my connection is slow/drops.

    Is there a solution?

    Thank you!

    Best

    Alex

    The problem here is that wireless between the airports will not quite work... If they work at all.

    You have a 'main' AirPort Extreme connected to your ISP modem/router using an Ethernet cable, and the airport is to 'create' the main wireless network... is that correct?

    And, you want the other 4 airports to extend wireless signal from the 'main' airport... is that correct?

    If so, then all the following 'rules' must be applied:

    (1) your 'main' AirPort Extreme must be at the heart of your home

    (2) each airport expansion must be on the same distance from the AirPort Extreme

    (3) each extension airport should be located, as it is closer to the 'main' than any other Airport Extreme AirPort which is the extension of the network

    The reason is that Apple offer wireless are works such as the hub and the spokes of a wheel.  AirPort Extreme 'main' would be 'hub' and each of the 4 Extenders would be located at the end of the separate 4 "rays". In this way, each extension connects directly to the 'main'... airport which is the only way an airport can extend wireless network.

    In other words, you cannot "extend" the network several times. Although you can have multiple extensions, each of them must be connected directly to the "main" airport  They cannot connect to another airport that extends the network already and lay it again.

    So, please tell us how well your current configuration meets the 3 above for a comprehensive wireless network.

Maybe you are looking for

  • The address bar is missing, replaced by a long version of the search bar.

    The address bar is supposed to be the long bar at the top of your browser, with a small bar of search at the right end. There is no more of the bar, and the long is the search bar. How can I fix?

  • Satellite A660-10w always freezes due to a higher temperature

    I have a toshiba Satellite A660-10wHe always hangs up and temprature freze and it is very high and there is no support on the toshiba Web site and it is still under warranty. I leave in the distrbuter local toshiba in Egypt but they, a group of peopl

  • IBooks author - Photos

    I can't navigate to my photographs in iBooks author - the media browser shows nothing. Is this a known problem? Is there a solution? Andrew

  • Restore my computer

    How do I restore my computer to factory, as when I bought my dv9912nr laptop Paolo, if I don't have my operating system disk. I tried to put xp on it, bad move, I deleted everything.its how do I restore my computer to factory, as when I bought my dv9

  • Where is the temporary folder?

    I'm new to computers and new for Windows 7.  When I download a program it says it is downloaded in a temporary folder.  Is this folder somewhere in our Galaxy?  Is there a way I can configure things so I don't know exactly what path to follow to find