REGEXP_LIKE for more of a range of numbers.

Hi all.


It is a pleasure to receive your help.

I use Oracle Database 10 g Enterprise Edition Release 10.2.0

I want to leave a string of pairs of numbers (where each pair represents a range) to know if my setting number is between pairs.

Something like the following.

SQL:

declare
  i     pls_integer := 0;
  s     varchar2(100) := '^([74010000-74019999]|[85990000-85990999])';
  test1 varchar2(8) := '64010000';
  test2 varchar2(8) := '74010000';
begin
  begin
    select 1 into i from dual where regexp_like(test1, s);
    dbms_output.put_line(i);
  exception
    when no_data_found then
      dbms_output.put_line(0);
  end;
  begin
    select 1 into i from dual where regexp_like(test2, s);
    dbms_output.put_line(i);
  exception
    when no_data_found then
      dbms_output.put_line(0);
  end;
end;


With the expected result below.

Output (It didn't happen):

0
1

Actual output:

1
1

Suggestions?

I'm looking for the literal correct.

I thank in advance

Filippe

No prob

drop table test

CREATE TABLE test

(NUMBER n

);

INSERT INTO test (n) VALUES (64010000);

INSERT INTO test (n) VALUES (74010000);

with input_data as)

Select regexp_substr (t.val, "[^;]") +', 1, level * 2-1) to_search, regexp_substr (t.val, "[^;]") +', 1, level * 2) end_num

(Select '74010000; 74019999; 84010000; 84019999; 94010000; 94019999' VAL double) t

connect regexp_substr (t.val, "[^;]") +', 1, level * 2) IS NOT NULL

)

Select

*

of input_data, test

where

n between to_search and end_num

TO_SEARCH END_NUM N

74010000 74019999 74010000

Just to get the whole picture

with input_data as)

Select regexp_substr (t.val, "[^;]") +', 1, level * 2-1) to_search, regexp_substr (t.val, "[^;]") +', 1, level * 2) end_num

(Select '74010000; 74019999; 84010000; 84019999; 94010000; 94019999' VAL double) t

connect regexp_substr (t.val, "[^;]") +', 1, level * 2) IS NOT NULL

)

Select

*

Of

input_data

full outer join

test

on

n between to_search and end_num

TO_SEARCH END_NUM N

74010000 74019999 74010000

84010000 84019999-

94010000 94019999-

-6401000

chris227: the entire image added

be complete it shoul be "n between to_number (start_num) and to_number (end_num)" accuracy

Tags: Database

Similar Questions

  • Else IF (javascript) with a range of numbers

    I create form fields in a PDF using Acrobat.  There is a field that you enter an amount (1-20, 21-100, + 100), and according to what is entered, the cost will be different.  If 1 to 20 units are the cost will be $ 199 per unit, 21 to 100 units, the cost is $ 175 per unit and 100 units, the cost is $ 150 per unit.  The line on the document looks like: number of Entities___ X price per Entity___ = Total___.

    That's what I have so far for the price;

    If (this.getField ("No. of the entities') .value == '1') {}

    Event.Value = 199

    } else if (this.getField ("No. of the entities') .value == '21') {}

    Event.Value = 175

    } else if (this.getField ("No. of the entities') .value == '101') {}

    Event.Value = 150

    } else {}

    Event.Value = 0 / / value here by default

    }

    I have it working for one number, I can't get a range of numbers.

    Any help would be great, thanks.

    The problem is in the logic of your condition.  This will hit only when you have the value of 1, 21, 101.

    I suggest you another game of logic, based on<=>

    If (this.getField ("No. of the entities') .value<= '20')="">

    Event.Value = 199

    } else if (this.getField ("No. of the entities') .value<= '100')="">

    Event.Value = 175

    } else if (this.getField ("No. (of the entities') .value > = '101') {}

    Event.Value = 150

    } else {}

    Event.Value = 0 / / value here by default

    }

    or something in that sense.  I also imagine that given the operators be digital (without the quotes on the constant) would be more effective.

    But it's general advice for JS and not tried within a form.

    Also, I have a question for you.  Are design you this as a PDF form in Acrobat, or you use LiveCycle Designer?  This information will help when we move this question in the appropriate forum.

  • How to find how many times, how many numbers in a range of numbers (number of lines and columns) has been repeated (numbers 3.6.2)

    Hello

    I have a range of numbers from B2 - B11 until the G2 - G11. For example:

    31

    7

    28

    10

    4

    17

    20

    13

    44

    2

    1

    39

    32

    45

    39

    4

    10

    25

    26

    38

    27

    43

    12

    3

    42

    35

    37

    1

    34

    21

    13

    39

    11

    14

    5

    37

    21

    33

    34

    4

    13

    10

    31

    14

    1

    24

    35

    3

    20

    2

    24

    27

    22

    30

    10

    34

    36

    32

    3

    27

    I would like to know who among these numbers have occurred and how many times. For example (just to have as an example): number 10 repetitions 5 times, number 13 repeated 3 times, 24 repetitions 9 times.

    Repeats = duplicates.

    I want to know all the repetitive number and how many times they repeat.

    Is there some kind of formula I can use to get there. It would be good to have the sorted result. For example:

    32 repeats 10 times

    24 repeat 9 times

    6 reps 8 times

    5 repeat 7 times

    22. repeat 6 times

    10 repeats 5 times and so on.

    Hello

    Problem of three steps:

    1. Determine the distinct values
    2. Count the number of times each appears in the table
    3. Sort by value or frequency (or both).

    The first step is easily handled by copy separate Automator Service, a Service of Automator, written by SGIII. A link to the file in post June 21 of the SG in this thread: Re: Analyzing column (maybe not the correct wording)

    After downloading and installing the service, select the cells containing the numbers, call the service, and then select the first regular (ie. non-header) cell to a new table and the dough.

    (The following assumes the new table has a header row, no column header, and you have selected - click - cell A2 before pasting.)

    You will get a list of distinct numbers in a single column (A2 - A34, of your sample and support of note).

    To count the numbers:

    In this example, the existing table is named 'Table 1'

    Enter the following formula in B2 the new table, and then fill up to the last line of the column B:

    = COUNTIF (Table 1::B:G, A)

    Results should be as shown:

    Sort the results on column (value) or B (frequency)

    Two types (A, then B) will be put in order of frequency, with values appear the same number of times sorted by value within this group.

    Kind regards

    Barry

  • You try to start a service error "Windows failed to start the VMware authorization on local computer Service. For more information, see the system event log. If it is a non-Microsoft service, contact the service provider

    Ideas:

    • You have problems with programs
    • ETrying to launch a service error "Windows failed to start the VMware authorization on local computer Service. For more information, see the system event log. If it is a Microsoft service, contact the service provider and refer to the specific service-6000004 error code "... I contacted the people at VMware they say it's a problem with Windows Vista..." IAM confused pls help... .rror messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Hi sanjeevkode,

    Thank you for visiting the website of Microsoft Windows Vista Community.  As the question you posted typically associated with third party software / application that has its own way of program codes and call the corresponding system resources when installing and running. Therefore, I also suggest you to join the VMware Forums for the best support.

    VMware communities: http://communities.vmware.com/home.jspa

    In the meantime I suggest you try these options / methods

    IMPORTANT NOTE: Microsoft provides this information as a convenience to you. Proposed changes could lead to serious problems. Microsoft cannot guarantee that problems would be solved as a result of the suggestions. Changes to settings are at your own risk.

    Option 1: If you go to computer management, and then to the list of Services and find the VMware authorization Service, it appears as stopped? If so, you need to start

    Option 2: Try logging on as an administrator Local host during installation first workstation, rather than you connect with a domain ID

    Option 3: The question can be caused also by your security program such an antivirus or a firewall of Windows /Defender that can have conflicting parameters as to not not to perform certain tasks. I suggest you temporary disable antivirus and firewall and check the result again. You must enable security programs new that had disabled you

    Option 4: The problem could be linked to a local or domain group policy. Make sure that the local account is defined as 'local user __vmware_user__' in the local Administrators group and the permissions of "Log on locally" and "Log on as a service.

    The two parameters are available in the "* Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment *" branch of domain group policy or local.

    Let me know if it worked.
    Hope it will be useful.

    Thank you and best regards,
    Vijay K - Microsoft Support
    Visit our Microsoft answers feedback Forum and let us know what you think.

    [If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message.] [Marking a post as answer, or relatively useful, you help others find the answer more quickly.]

  • Range of numbers

    Hello. I have just a simple range of numbers and I want to output the results. I will return results, but for some reason, it displays only the first result. Why t - he did not display the correct result? Here's what I have:

    < cfset X = 27 >

    < cfset Y = 37 >

    < cfif (#X # 35 LT GT 51 and #Y # GT 1 LT 35) >

    < cfset result = 200 >

    < cfelseif (#X # GT 1 LT 35 and #Y # GT LT 51 35) >

    < cfset result = 300 >

    < cfelseif (#X # 35 LT GT 51 and #Y # GT LT 51 35) >

    < cfset result = 100 >

    < / cfif >

    < cfoutput >

    #Result #.

    < / cfoutput >

    Since X is 27 and Y 37 it should produce 300 as the result, but he shows 200. Why is this? What should I do to fix this? Thank you.

    Andy

    Basically you are trying to use logic X > 35<51 and="" i="" don't="" think="" cf="" supports="" this="" form="" of="" "between"="" logic="" and="" i="" have="" no="" clue="" as="" to="" what="" logic="" cf="" is="" actually="" performing.="" i'm="" surprised="" it="" is="" not="" puking="" out="" an="" error="" message.="" instead="">

    Also the result is undefined if any of these conditions do not so it would be wise to include a block of final.

  • Remove the range of numbers from a text string

    I have a field that I need to remove a certain range of numbers, however, this area is VARCHAR2 and can contain letters.

    My current code is (in the Where clause): field.field_name not between '27000000' and '27999999'

    The problem is that it takes also documents that are not in this range, such as 27000.

    What code can I set in the where clause to fix this?

    OK, then change the class alnum class numbers:

    SELECT *.

    From your_table

    If NOT of REGEXP_LIKE (your_col, ' ^ 27 [[: digit:]] {6} $');

  • I bought the photo Illustrator and ask the Adobe site plan for individuals with credit cards, but to date I have not received the confirmation email. How can I contact for more information on the good end of the order?

    Hello 11/18/2015 I bought Illustrator photo and ask the Adobe site plan for individuals with credit cards, but to date I have not received the confirmation email. How can I contact for more information on the good end of the order?

    Your subscription to cloud shows correctly on your account page?

    If you have more than one email, you will be sure that you use the right Adobe ID?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    .

    If Yes

    Some general information for a subscription of cloud

    Cloud programs don't use serial... numbers you, connect you to your cloud account paying to download & install & activate... you may need to sign out of the cloud and restart your computer and log into the cloud for things to work

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    .

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

  • A single button for more than one task?

    I have search the forum but vacuum came on it.  So, if it has been discussed, I apologize in advance!

    I have a form with auto numbering as a way to keep track of individual requests.  My shape is on a network drive.  I would add a single button that does the following: SAVE the file of the application number/PRINT the application to the person assigned to printer automatically / OPEN an email that uses the demand for the subject heading number and adapts electronic mail form, clicking 1 button on the form. Is this possible with a script? or what I need to do the individual buttons?

    Any input you would know that my plant manager is everywhere on me to get there!

    Thank you

    Brian

    All this can be done with a single button using JavaScript. Here are some tips:

    1. for more information on the savings, see: https://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

    2. printing is easy using the JavaScript doc.print method. More information is in the Acrobat JavaScript reference, which is included in the kit SDK Acrobat: Acrobat SDK Documentation DC | Adobe Developer Connection

    3. you can start an email in various ways as shown here: https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address

    The doc.mailDoc method will be probably the most flexible for what you do.

  • What query can we use... .for more than 30 days

    Select the PROPERTY, RELAVANTDATE,
    Sum (records) more)
    partition of property
    order of RELAVANTDATE
    between the '30' day interval preceding and the current line
    ) "SUM".
    of Test_Data

    What query can we use... .for more than 30 days
    can I use following or preceding
    SCOTT@soti_9> WITH Test_Data AS (
      2    select 10100 as property, to_date('25-JAN-07') as RelavantDate, 20 as notices from dual union all
      3    select 10100 as property, to_date('25-DEC-07') as RelavantDate, 5 as notices from dual union all
      4    select 10100 as property, to_date('02-JAN-08') as RelavantDate, 10 as notices from dual union all
      5    select 10100 as property, to_date('01-DEC-08') as RelavantDate, 10 as notices from dual union all
      6    select 10100 as property, to_date('02-DEC-08') as RelavantDate, 20 as notices from dual union all
      7    select 10100 as property, to_date('31-DEC-08') as RelavantDate, 20 as notices from dual union all
      8    select 10100 as property, to_date('03-JAN-09') as RelavantDate, 30 as notices from dual union all
      9    select 10100 as property, to_date('25-JAN-09') as RelavantDate, 20 as notices from dual
     10  )
     11  select PROPERTY,RELAVANTDATE ,
     12    sum(NOTICES) over (
     13      partition by property
     14      order by RELAVANTDATE
     15      range between current row and interval '30' day following
     16    ) "SUM"
     17  from Test_Data
     18  ;
    
      PROPERTY RELAVANTD        SUM
    ---------- --------- ----------
         10100 25-jan-07         20
         10100 25-dec-07         15
         10100 02-jan-08         10
         10100 01-dec-08         50
         10100 02-dec-08         40
         10100 31-dec-08         70
         10100 03-jan-09         50
         10100 25-jan-09         20
    
    8 rows selected.
    

    Kind regards
    Dima

  • Phone has been "redevelopment" iCloud drive for more than a day now

    In parameters, iCloud Drive was churning "valorisation" for more than a day now. Did not help restart the phone. iPhone 6 s, iOS 10.0.2.

    Thank you!

    What kind of "reboot", you have?  What was this - restart your iPhone, iPad or iPod touch - Apple Support?  If you did, and it did not work, try switching iCloud drive, power switch (settings > iCloud > iCloud drive).  If this does not work, try to connect to your iCloud account and reconnect.

  • Whenever I try to open the App Store it will remain open for more than 30 seconds before the close. Or it just restarts as soon as a home screen scroll above him. I can't keep it open long enough to even download an application.

    Whenever I try to open the App Store it will remain open for more than 30 seconds before the close. Or it just restarts as soon as a home screen scroll above him. I can't keep it open long enough to even download an application.

    Hello monorayfromportland,

    If you are unable to connect to the iTunes Store on your Apple TV, take a look at the troubleshooting steps below:

    If you cannot connect to the iTunes Store

    If you cannot connect to the iTunes Store on your Apple TV (4th generation):

    1. Make sure that your date and time are correct. Go to settings > general > Date and time.
    2. Check if your Apple TV software is up-to-date. To check the updates, select settings > system > software updates > software update.
    3. Make sure you have an active network connection. Go to settings > network.
    4. Check to see if other devices, such as computers or tablets, can connect to Wi - Fi and access to the Internet.
    5. Reset the wireless router by turning and then again.

    Take care.

  • Introduction to iCloud but "glued" for more than 12 hours

    I am new to icloud and try to put up my pictures in icloud.

    in the Photos on my imac, he says it's "uploading 11 983 points", but he's been stuck like that for more than 12 hours.

    If I click on icloud in system preferences, it is also stuck and will not let me click on anything whatsoever.

    What should I do now?

    The first part in the photos is not uncommon, the initial download may take days and seems to stall for long periods of time. The second part on the system preferences is unusual, have you tried to restart the Mac yet.

  • I tried to erase and reset my iphone 6 s. But why is it taking so long? For more than 24 hours. Is this normal? The phone displays just the apple logo and wont open. Help, please. Thank you in advance.

    I tried to erase and reset my iphone 6 s. But why is it taking so long? For more than 24 hours. Is this normal? The phone displays just the apple logo and wont open. Help, please. Thank you in advance.

    Hello

    Follow the instructions here:

    If you are unable to update or restore your iPhone, iPad or iPod touch - Apple supports

  • Is there a way to block a range of numbers?

    A group of Washington calls several times a day and I continue to block the numbers, but it's always a slightly different ending every time. Is there a way to block a range of numbers?

    No, it's not

  • Sync to iphoto with Iphone hangs on during synchronization. In addition the google map can be charged when I click on the places of Mediathek. Error message: "this page has not loaded correctly Google Maps. See the JavaScript console for more technical de

    Sync to iphoto with Iphone hangs on during synchronization. In addition the google map can be charged when I click on the places of Mediathek. Error message: "this page has not loaded correctly Google Maps. See the JavaScript console for more technical details. »

    Perhaps the reason for the problem of synchronization is the problem with the loading of google map?

    Error message: "this page has not loaded correctly Google Maps. See the JavaScript console for more technical details. »

    Apple has not renewed the contract with Google to access Google servers.

    If the old version of iPhoto, which are still using Google's servers for the cards and places are either crashing or hanging.  Places are only work in iPhoto 9.5.1 or newer, who use places of Apple servers.

    There is more support for iPhoto from Apple.  You must update iPhoto 9.5.1 with the Mavericks. It would work well, only it is no longer buying this update to Apple.

    Perhaps the reason for the problem of synchronization is the problem with the loading of google map?

    It is very likely.  If iPhoto work very well when you are offline, then your problems will be caused by the connection failed to Googles servers.

    See this: Bug: iPhoto 9.4 crashing when viewing the scene

Maybe you are looking for