query to get the maximum integer value of varchar columns

I have the following values in the column of type Varchar.

USR_LOGIN (VARCHAR2)
-----------------------------
50
52
53
55
57
123
111
145
XELSYSADM
TESTUSER
USER123
12TESTUSER

But I need to get the result as 145.

Can you help me with the sql query?

Maybe it's

SQL> with t as (
 select '50' usr_login from dual union all
 select '52' from dual union all
 select '53' from dual union all
 select '55' from dual union all
 select '57' from dual union all
 select '123' from dual union all
 select '111' from dual union all
 select '145' from dual union all
 select 'XELSYSADM' from dual union all
 select 'TESTUSER' from dual union all
 select 'USER123' from dual union all
 select '12TESTUSER' from dual
)
--
--
select max(to_number(regexp_substr(usr_login, '\d+'))) usr_login from t
/
      USR_LOGIN
---------------
            145
1 row selected.

Tags: Database

Similar Questions

  • Query to get the flex field values description.

    Hello

    Entering invoices-> all the Distributions screen 'Special Mentions for the India' is here. Here we enter the value for the field TDS - tax. I want to get the list of values for TDS - tax in a query.

    Can you please help me.

    Thank you

    Nanga.

    where 'jtc.tax_type =' TDS

    and jtc.section_type = 'TDS_SECTION. '

    and org_id =: inv_sum_folder.org_id

    and jtc.section_code in

    (

    Select section_code

    of jai_ap_tds_th_vsite_v

    where vendor_id =: inv_sum_folder.vendor_id

    and vendor_site_id =: inv_sum_folder.vendor_site_id

    )

    order of jtc.tax_id

  • How to get the maximum/more value in one line?

    I have a simple table view Pivot with dollars as a measure, a month on accounts on the rows and columns.  I want to emphasize the month that has the greatest value.  For example if the market value for the revenue account is for Jan, Feb 11, 50 Mar 10 and 0 for the rest of the month, then so I want to highlight the cell that contains 50 green. So, basically, I need to be able to identify the max value in a row in the PivotTable.

    If I add a max calculation, it returns the top value in all columns and rows. A calculation of rank also returns the rankings in all the columns and rows. How can I determine the largest value in a single row?

    Thank you

    J

    In general, go through measures based on level. Just tweak it like max (income per year)

    Just do it in the criteria tab and see how it works and I still thing you know how to

  • Get the maximum index of a vector of growth

    Hello

    I'm having a very strange problem. I simulate data with an sine function in a while loop and I keep the values< 0.7="" into="" a="" vector.="" when="" the="" sinus="" values="" are="" over="" 0.7,="" i="" remove="" the="" vector.="">

    I would like to get the maximum index of the vector at each iteration of the loop. However, I get a zero index while the vector has a size > 0.

    It's really strange, because if I put the values of the iteration instead of the values of the sine, the index created is correct (the only difference is that the iteration number is an integer, while the sine is a decimal number).

    To make someone understand something?

    Thanks for your help

    Andrew

    Instead of "delete table", just leave the REAL empty case and 'use default if unwired' on the output of the table tunnel.

    Once the sinuses is once again<0.7, you="" are="" on="" the="" descending="" branch,="" so="" the="" first="" element="" is="" always="" the="" largest="" for="" a="" while.="" nothing="" wrong="" with="">

    I would also put indicators after the case structure so they update in all conditions.

    Table min & Max will give you the index of the element with the highest value. If you want to know the size of the array, use the function "size of array".

  • SQL query to get the NULL records after the last matching flag

    I have a xx1 table with id and flag columns. So I want the data in this table, after the last flag matched. I want that data to id 7 in the rooms. Even if the id 2,3,5 are null flag 'Y' was at 6. ID so I need a query to get the data of the xx1 table after the last correspondence flag (from 7 to 9 id).

    SQL > create table xx1

    2 (identification number,

    3 flag varchar2 (10));

    Table created.

    SQL > insert into xx1 values (1, 'Y');

    1 line of creation.

    SQL > insert into values xx1 (2, null);

    1 line of creation.

    SQL > insert into values xx1 (3, null);

    1 line of creation.

    SQL > insert into xx1 values (4, 'Y');

    1 line of creation.

    SQL > insert into values xx1 (5, null);

    1 line of creation.

    SQL > insert into xx1 values (6, 'Y');

    1 line of creation.

    SQL > insert into values xx1 (7, null);

    1 line of creation.

    SQL > insert into values xx1 (8, null);

    1 line of creation.

    SQL > insert into values xx1 (9, null);

    1 line of creation.

    SQL > select * from xx1.

    FLAG OF THE ID

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

    1. IS

    2

    3

    4. IS

    5

    6. IS

    7

    8

    9

    9 selected lines.

    SQL >

    Hello

    user11164339 wrote:

    Hi Frank - when I run the query, I don't see the results data.

    I get

    FLAG OF THE ID

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

    7

    8

    9

    What you do differently?

  • Query to get the data of the column and the metadata in the same set of results.

    Is it possible to build a query to get the values of the columns in a table and also be able to get some metadata (data type, data_length, data_precision, data_scale) for columns in the same set of results.

    If I use a join, have a common value to join on the two tables?

    you use a cross join, not requiring common values.

    create table T (n number, d date, v varchar2(30));
    insert into T values (1,sysdate,'ABC');
    commit;
    
    select C.column_name, c.data_type, c.data_length,
    case c.column_id
     when 1 then to_char(T.N)
     when 2 then to_char(T.D)
     when 3 then T.V
    end VALUE
    from USER_TAB_COLUMNS C, T
    where C.table_name='T'
    order by c.column_id;
    
  • How can I get the maximum salary of the first ascending

    Hello

    How can I get the maximum salary of the first in ascending order.
    I need the sql query.

    want my output:

    Emp_name salary
    A 5000
    SS 100
    300 AA
    DD 700
    WW 2000



    Thank you
    Walid.

    Here is an example:

    SQL> with mytable as
      2  ( select 'aa' as col1,  300 col2 from dual union all
      3    select 'ss' as col1,  100 col2 from dual union all
      4    select 'a'  as col1, 5000 col2 from dual union all
      5    select 'dd' as col1,  700 col2 from dual union all
      6    select 'ww' as col1, 2000 col2 from dual )
      7  select col1, col2
      8  from   mytable
      9  order by decode(row_number() over (order by col2 desc),1,0,1),col2;
    
    CO       COL2
    -- ----------
    a        5000
    ss        100
    aa        300
    dd        700
    ww       2000
    
    SQL>
    

    Nicolas.

  • Get the range of values such as the value of my line

    Hello

    I want one of my column in the table ("for example: column name = ' GVW") appears as below
    {code}
    PBV
    ----------------
    0-> 5
    5. > 10
    10 > 15
    {code}


    The values of the line comes from the table, called report_range_parameters table and it looks like in below

    {code}

    ID group name min_value max_value
    1 gvw_group 0 5 gvw_name
    gvw_group 2 5 10 gvw_name
    3 gvw_group 10 15 gvw_name

    {code}

    Here's my INSERT sample data.
    {code}

    INSERT INTO REPORT_RANGE_PARAMETERS (ID, GROUP, NAME, MIN_VALUE, MAX_VALUE)
    VALUES ('1 ', 'SPEED_GROUP', 'SPEED_NAME', '0', 5')
    INSERT INTO REPORT_RANGE_PARAMETERS (ID, GROUP, NAME, MIN_VALUE, MAX_VALUE)
    VALUES ('2 ', 'SPEED_GROUP', 'SPEED_NAME', '5', 10')
    INSERT INTO REPORT_RANGE_PARAMETERS (ID, GROUP, NAME, MIN_VALUE, MAX_VALUE)
    VALUES ('3 ', 'SPEED_GROUP', 'SPEED_NAME', '10', 15')


    {code}

    How I write a query to get the values of line like below?

    -----------------
    GVW |
    -----------------
    0-> 5
    5. > 10
    10 > 15



    Thank you

    Hello

    SELECT min_value || ' -> ' || max_value AS GVW FROM REPORT_RANGE_PARAMETERS;
    

    Kind regards

    Published by: Walter Fernández on 12 June 2009 20:45

  • How to read or get the current selected value of selectonechoice

    How to read or get the current selected value of selectonechoice, so that it can be used in the custom query.

    selectOneChoice11.getValue () m:System.NET.SocketAddress.ToString () returns the index of the list.

    from 0 - number of values in selectonechoice.

    I want to read the exact value of selected.

    Concerning

    Niaz M

    Why don't you try this?

    Re: Value of SelectOneChoice in valueChangeListener

    Both approaches will work...

    Julian

  • How to get the ActiveX component value change event?

    Hi all

    LV 8.6.1

    I try to get the ActiveX component value change event. I covered forum and through examples, but I can't get an idea of how "Recalling vi. For example, in the example 'ActiveX event Callback for IE.vi' it is used "recall vi". I've added an example where the change event of value with the mouse to the bottom of the event are scheduled to the structure of the event. Mouse down event OK work but change the value no. Can anyone describe what I need to add to my example vi who value the change event works fine?

    BR, Jim

    Here is the solution! "Value changed event" is not performed in the structure of the event, but in "Reminder VI".

  • How to get the maximum number of iterations in the property of TS

    I was put the loopType from one step to the count of success/failure. For example "stop after 1 iterations pass or a maximum of 3 iterations. The maximum iteration is 3. What my qustion is how to get the maximum iteration of TS property by codes of trial during the race. Thank you very much!

    Corey Chen

    The OPPO test developer

    Hello

    It may be a hack, but RunState.Step.LoopWhileExpression has information.  It will return a string like: "RunState.LoopIndex."< 69="" &&="" runstate.loopnumpassed=""><>

  • How to get the maximum number of days in a month?

    How to get the maximum number of days in a month?

    I use a dateField. where I can get the month. Now, I want to get the maximum number of days in a month.

    How can I get it?

    Please help me. and thanks in advance... []

    NET. RIM. Device.API.util
    Class DateTimeUtilities

    getNumberOfDaysInMonth (int month, int year)
    Returns the number of days in the specified month

    It took me like 10 seconds to find it in the API, I guess you spent more time writing the post...

  • Unable to get the maximum screen resolution when you use the external monitor

    Hello

    I use Windows 8 on laptop ASUS K55A. I use an external monitor (Samsung SyncMaster 2233BW). Everything works fine except that I do not get the maximum resolution on the external display. The only way I see a sort of an overview of the good resolution is when I choose "extend these screens", but it's very uncomfortable when there's always one screen, I don't actually see.
    How can I increase the resolution of the screen on the external screen? (now, it's on 'show desktop only on 2')
    Thank you!
    I use Windows 8 on laptop ASUS K55A.

    So first a Bing search finds that ASUS K55A probably has the chip Intel HD 4000

    Then,

    https://communities.Intel.com/thread/30360

    (BING search engine for)
    Two monitors specifications Intel HD Graphics 4000

    )

    Graphics card Intel doesn't support double bond, so 1920 x 1200 is the maximum for DVI and HDMI, 2560 x 1440 is only possible with a display port. This is indicated in each product page.

  • IOM sql Query to get the status of the failed task

    Hello world

    We have an obligation as we need to get the status of a particular task (say Create User in OID - Completed\Rejected status resource) for the particular user. We are able to get the status of the provisioed of resources to the user but not the status of the special mission which is trigerred for the user.can someone put some light on it. We must have the SQL query to do this.

    Thanks in advance.

    Kind regards
    MKN

    Hello
    Use this query to get the status of the task, also check the cooments

    SELECT USR. USR_LOGIN, OSI. SCH_KEY, ANN. SCH_STATUS, STA. STA_BUCKET OF
    OSI, CHS, STA, MIL, TOS, PKG, OUEDRAOGO, USR, OBJ, OST
    WHERE OSI.MIL_KEY = MIL.MIL_KEY
    AND ANN. SCH_KEY = OSI. SCH_KEY
    AND STA. STA_STATUS = SCH. SCH_STATUS
    AND TOS. PKG_KEY = PKG. PKG_KEY
    AND MIL. TOS_KEY = TOS. TOS_KEY
    AND OUÉDRAOGO. USR_KEY = USR. USR_KEY
    AND OUÉDRAOGO. OST_KEY = OST. OST_KEY
    AND OST. OBJ_KEY = OBJ. OBJ_KEY
    AND OSI. ORC_KEY = OUEDRAOGO. ORC_KEY
    AND OBJ. OBJ_NAME = "User AD".
    AND OST. OST_STATUS = "Provisioning" - filter accordinglly
    AND STA. STA_BUCKET = 'pending' - filter accordinglly
    AND PKG. PKG_NAME = "AD User" - filter accordinglly
    AND MIL.MIL_NAME = 'System' - filter accordinglly Validation
    ;
    Thank you
    Kuldeep

  • How to write a simple select query to get the data of the table as an XML.

    How to write a simple select query to get the data of the table as an XML. In the query, I'm just adding items below which i need be there in the XML document
    select '<test_tag>'||EMP_NAME||'</test_tag>','<date>'||sysdate||'</date>' 
    from temp_table where id_num BETWEEN 1 AND 10;
    I have need to add the root tag as well in the beginning and the end of < root > < / root > this xml file. Please advice if this is possible with the select query
    without using XMLGEN, XMLQUERY or any other packages built and function?

    I need to URL escapes with the UTF-8 code points that we have already achieved using the utl_http package. Please help how to do that without using the utl_http package.

    What is wrong with him?

    At present, the only way I can think of to avoid a call to UTL_HTTP. SET_BODY_CHARSET is to write your own little wrapper.
    In this way, you can specify the Boolean parameter or omit it if you choose to use named parameters:

    SQL> create or replace function my_url_escape (url in varchar2)
      2  return varchar2
      3  deterministic
      4  is
      5  begin
      6   return utl_url.escape(url, false, 'AL32UTF8');
      7  end;
      8  /
    
    Function created
    
    SQL> select my_url_escape('http://some.uri.com/param?lang=fr&text=contrôle') from dual;
    
    MY_URL_ESCAPE('HTTP://SOME.URI
    --------------------------------------------------------------------------------
    http://some.uri.com/param?lang=fr&text=contr%C3%B4le
     
    

Maybe you are looking for

  • I'm unable to download free applications. Message screen "check required".

    My iphone is iphone 4S Model: MC922LL/A Series: C8 * T9V IMEI: *. Question: Unable to download apps from the app store < personal information under the direction of the host >

  • Satellite L falls down after returning from the mode "sleep."

    My laptop has this bug, whenever he goes to "sleep" when it "wake up" the system said that Explorer windows stopped working and almost everytime I have to restart with the power switch. I changed the operating system from Vista to windows 7, but he c

  • HD DVD - ROM driver is missing or corrupt on Satellite A200-s 23

    Hi, recently I bought my Toshiba Satellite A200-23 s and now it says that the HD DVD-ROM driver is missing or currupted. The system can not see DVD - ROM. My laptop is still under warranty, but perhaps I can fix it somehow? I found the list of driver

  • Other computers cannot access my shared folders

    I searched this topic and I read all the messages that seem to apply to me.  I still have the problem.  Maybe it's something unique to my setup. My computers: XP Pro (desktop computer) XP Home (laptop) Windows 7 (laptop) I shared the files back and f

  • Message secure connection Fail of the unit

    I just installed the unit connection Version 8.6.2.20000 - 2. I'm under the license by default until I get my Cisco license files. I added a user and when I call the user and then he attends opening of greeting, attempts to transfer to the operator a