To meet a numeric value in SQL

Dear friends

I have a field in a table of characters. Values of a field as below

col_value

50/60

103/104

49/50

I want to take the values before / eg 50,103,49 how can I do this in SQL.

Concerning

Kam

As I suppose, you need like below.

If you have 5686890 then you must display as is right?

for this use it...

Select SUBSTR (col_value, 1, (decode (INSTR(col_value,'/'), 0, length (col_value) + 1, INSTR(col_value,'/')))-1) doubles.

Tags: Database

Similar Questions

  • SQL: How to tell the difference between the numerical value and Alpha numeric

    Pls check the following requirements and let me know how to prepare the SQL:

    1. I want to find the product that begins with Alpha value separately

    2. I want to find the product that starts with the numerical value separately

    data are the following:
    CREATE TABLE prod
        (product_code                   VARCHAR2(4) NOT NULL)
    INSERT INTO prod
    VALUES
    ('L016')
    /
    INSERT INTO prod
    VALUES
    ('A035')
    /
    INSERT INTO prod
    VALUES
    ('B001')
    /
    INSERT INTO prod
    VALUES
    ('1717')
    /
    INSERT INTO prod
    VALUES
    ('7151')
    /
    INSERT INTO prod
    VALUES
    ('7019')
    /
    INSERT INTO prod
    VALUES
    ('0729')
    /
    INSERT INTO prod
    VALUES
    ('0730')
    /
    INSERT INTO prod
    VALUES
    ('L007')
    /
    INSERT INTO prod
    VALUES
    ('C013')
    /
    INSERT INTO prod
    VALUES
    ('D008')
    /
    INSERT INTO prod
    VALUES
    ('L021')
    /
    INSERT INTO prod
    VALUES
    ('0710')
    /
    INSERT INTO prod
    VALUES
    ('0718')
    /
    INSERT INTO prod
    VALUES
    ('L005')
    /
    INSERT INTO prod
    VALUES
    ('0716')
    /
    INSERT INTO prod
    VALUES
    ('0711')
    /
    INSERT INTO prod
    VALUES
    ('0701')
    /
    INSERT INTO prod
    VALUES
    ('0724')
    /
    INSERT INTO prod
    VALUES
    ('0728')
    /
    INSERT INTO prod
    VALUES
    ('0714')
    /
    INSERT INTO prod
    VALUES
    ('0704')
    /
    INSERT INTO prod
    VALUES
    ('7150')
    /
    INSERT INTO prod
    VALUES
    ('L024')
    /
    INSERT INTO prod
    VALUES
    ('L033')
    /
    INSERT INTO prod
    VALUES
    ('0721')
    /
    INSERT INTO prod
    VALUES
    ('0708')
    /
    INSERT INTO prod
    VALUES
    ('0723')
    /
    INSERT INTO prod
    VALUES
    ('L004')
    /
    INSERT INTO prod
    VALUES
    ('L018')
    /
    INSERT INTO prod
    VALUES
    ('0725')
    /
    INSERT INTO prod
    VALUES
    ('0719')
    /
    INSERT INTO prod
    VALUES
    ('0726')
    /
    INSERT INTO prod
    VALUES
    ('0712')
    /
    INSERT INTO prod
    VALUES
    ('0727')
    /
    INSERT INTO prod
    VALUES
    ('0703')
    /
    INSERT INTO prod
    VALUES
    ('TEST')
    /
    Kind regards

    Yamen
    1)select * from prod where translate(substr(product_code,1,1),'#0123456789','#') != '#'
    
    2)select * from prod where translate(substr(product_code,1,1),'#0123456789','#') is null
    

    Ravi Kumar

  • How to interpret the numerical values of SQL_ColType()?

    Hello

    After the execution of:
    ..
    Call SQL_Connect("abcDB","user","pw","") ' abcDB is an ODBC link to my Mysql 5 database
    Call SQL_ExecDirect ("SELECT id, temperature, tsdat FROM v$ _header WHERE id")< 1000")="">
    ..

    > the SQL_ColType(1..ColumnNo) variable shows me the data types of each column to a numeric value, for example:

    SQL_ColType (1) = 4
    SQL_ColType (2) = - 9
    SQL_ColType (3) = 93

    What real data types are behind the values? It would be nice to get a complete list of all possible values?

    Thank you.

    Hi ddehn,

    The SQL_... orders () are the old method for DIAdem to connect to SQL databases, using the ODBC approach.  Since the tiara 10.2 the ADO approach is the recommended method.  This is the function that I used to use to make sense of the values SQL_ColType():

    Function GetODBColTypes()
    Dim j, jMax, ChTypes
    jMax = SQL_ResultCols
    < 1="" then="" jmax="">
    ReDim ChTypes (jMax)
    FOR j = 1 TO jMax
    IF SQL_ColType (j) = 93 THEN
    ChTypes (j) = "DateTime".
    Else if SQL_ColType = - 1 OR SQL_ColType (j) (j) > 8 THEN ' STRING
    ChTypes (j) = "String".
    ON THE OTHER
    ChTypes (j) = 'number '.
    END IF ' SQL_ColType (j)
    NEXT ' j
    GetODBColTypes = ChTypes
    End Function ' GetODBColTypes()

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Find the maximum numeric value to a String

    Hi all

    I want to find the maximum number of the string using PLSQL. How can I do this simply.

    Example string: "D32X1U7".

    And I want to get maximum numeric value is of this string. (7)

    Thank you

    Something like this:

    SQL >

    SQL > with input_data (select ' D32X1U7' double Str).

    2 split_char AS (select substr (str, level 1) c

    input_data 3

    4. connect by level<=>

    5                     )

    6 select max (c)

    7 of split_char

    8 where the regexp_like (c, ' [[: digit :]]');]])

    MAX (C)

    ------

    7

    SQL >

  • How to make a multiple numeric value to another page

    Dear Experts,

    Apex 4.1

    Oracle 11g

    I would like to pass multiple numeric value to another page, as below:

    P1_ID = (11,22,33) POINT Page1 depend on what users chose

    P2 SQL: SELECT * FROM TABLE WHERE ID IN (11,22,33), ID is numeric fields.

    but the PAGE 2 to show the error invalid number, how to fix, please help me.

    Thanks and greetings

    Yong Huang wrote:

    Dear Experts,

    Apex 4.1

    Oracle 11g

    I would like to pass multiple numeric value to another page, as below:

    P1_ID = (11,22,33) POINT Page1 depend on what users chose

    P2 SQL: SELECT * FROM TABLE WHERE ID IN (11,22,33), ID is numeric fields.

    but the PAGE 2 to show the error invalid number, how to fix, please help me.

    This is the classic problem 'variable IN the list' (I have no idea why this misunderstanding is so widespread. Always seemed obvious to me that it doesn't). In

    select * from table where columnvalue in (7788, 7839, 7876)
    

    (7788, 7839, 7876)is a list of expressions and the predicate is evaluated as a membership condition.

    In

    select * from table where columnvalue in :P1_X
    

    :P1_Xis a scalar string, unable to contain multiple values.

    In a report of type APEX, a source report of the body of the PL/SQL function returning a SQL query with lexical substitution can be used to produce a "variable list:

    return 'select * from table where columnvalue in (' || :P1_X || ')';
    

    where P1_X contains less than 1000 values, has been disinfected to code SQL injectionand string values are properly cited.

    Some people suggest the following approach, that will work also in interactive APEX reports:

    select * from table where instr(':' || :P1_X || ':', ':' || columnvalue || ':') > 0
    

    However, it is underperforming because it eliminates the possibility of using the index optimizer or the size of the partition in the execution plan.

    See various elements in the list to ask Tom and imitating the channel to the table using sql features for effective solutions.

  • What is javascript customized for converting an estimate of the numerical value in equivalent term?


    Hello fellow Adobe users,.

    I'm trying to find a way to see the numerical value of average and presents its equivalent word.  Rather than display the number, it should show the following:

    A numeric score from 3.1 to 4 should show as pending

    A digital index of 2.1 to 3 should show meets expectations

    A numeric score from 1.5 to 2 should show as below performance

    A rating of 1 to 1.4 should show as failure

    Should what simple javascript I type the javascript custom in the text field properties?

    Looking forward to your comments.

    Thanks in advance!

    Jonathan

    You have a field that is the calculation of this average in number? Let's say you do and it's called 'average '. You can then use this code as the custom for the field "Average in the words:" calculation script

    event.value = "";
    var a = +this.getField("Average").value;
    if (a>=1 && a<=1.4) event.value = "Fail";
    else if (a>=1.5 && a<=2) event.value = "below performance";
    else if (a>=2.1 && a<=3) event.value = "Meeting Expectations";
    else if (a>=3.1 && a<=4) event.value = "Outstanding";
    
  • Sort a column as a numeric value

    Hello

    I created a SQL report from collections and problems with the sorting of the column as a numeric value.

    I used create_collection_from_query2 for my digital set as a variable n001. But, when I use the same in my SQL statement, it is considering the column as a string.

    Please advise if I am doing something wrong that is causing this problem.

    Thank you in advance,

    Madan

    Thanks for the reply fac586.

    Is to help sort the value column, but we hide the column, users do not have it sort by themselves.

    I have solved this problem by using the interactive report and did not apex_item.display_and_save () but used n001 column directly in the select statement. It is allowing me to sort as a numeric value.

  • the index of the first/last numerical value

    Hello

    I want to find the index of the first numeric value in a string. I can do this by using built-in features of Oracle? (Without creating a new function)

    I want to find the index of the first numeric value in a string

    regexp_instr could do (for the first digit):

    SQL> select regexp_instr('abc1def2', '\d') first_digit from dual
    /
    FIRST_DIGIT
    -----------
              4
    1 row selected.
    
  • How to get the day as a numeric value without the date in shape?

    Hello
    to reduce the costs of a sql statement, I need to get the day of a date under the number (to compare to a numerical value) value without formatting. Each formatting causes a complete table of the table scan and the date field. Is there a function for this problem?

    Version of Oracle's 11g.

    Thank you Carsten

    You can use EXTRACT...

    SQL> select extract(day from sysdate) from dual;
    
    EXTRACT(DAYFROMSYSDATE)
    -----------------------
                          7
    
    SQL>
    
  • Extract all numerical values of &gt; = 10 length

    Hi all

    I have a table named "STS_HISTORY".
    in which I have 2 fields
    Number STSID
    History varchar2 (4000)

    I need to create another table that has 2 fields
    stsid, mynum
    where stsid is the same from the table of sts_history
    and mynum will contain the numerical value of > = length 10.

    for example
    will he be stsid: 1 the history field is
    "123456789 1234567890 here 12345678901 123456789012 1234567890123 data please 12345678901234 seprate 1'
    You must then put

    1 1234567890
    1 12345678901
    1 123456789012
    1 1234567890123
    1 123456789012345

    is there way to sm to do using only does not xmltable

    of course there are:

    SQL> with sts_history as (
     select 1 stsid, '123456789 here 1234567890 is 12345678901 some 123456789012 data 1234567890123 plz 12345678901234 seprate 1' history from dual union all
     select 2 stsid, '123456789 here 1234567890 is 12345678901 some 123456789012 data 1234567890123 plz 12345678901234 seprate 1' history from dual
    )
    --
    --
    select stsid, regexp_substr (history, '\w+', 1, level) history
      from sts_history
     where rtrim (regexp_substr (history, '\w+', 1, level), '0123456789') is null
           and length (regexp_substr (history, '\w+', 1, level)) >= 10
    connect by     level <= length (history) - length (replace (history, ' '))
               and prior stsid = stsid
               and prior sys_guid () is not null
    /
              STSID HISTORY
    --------------- ---------------
                  1 1234567890
                  1 12345678901
                  1 123456789012
                  1 1234567890123
                  1 12345678901234
                  2 1234567890
                  2 12345678901
                  2 123456789012
                  2 1234567890123
                  2 12345678901234 
    
    10 rows selected.
    
  • Strings, the formula = numeric values?

    is there a way of having a cell to display a string numbers, but when this cell is referenced in a formula it will be used as a numerical value? See screenshot.

    I want the storage capacity label.

    I want the strings displayed in column A to represent numeric values in column B.

    then "128 GB" = 0.13. or "128 GB" = B2. I need a cell to associate it with the value of the other.

    My goal is to make a column of pop-ups with storage capacities that can be used in a formula in another table.

    If you choose "128 GB" I want its value to be 0.13

    I prefer to use a table of choice like that.

    (1) create a table (as you have) that contains the list of text and the corresponding values

    I named the 'TaillePour Value' table

    In the table where you want to use, use the following formula:

    C2 = SIERREUR (IF (VLOOKUP (B2, TaillePour Value::A:B, 2, 0) = 0, ' ", VLOOKUP (B2, TaillePour Value::A:B, 2, 0))," ")

    It's shorthand dethrone select cell C2, then type (or copy and paste it here) the formula:

    = SIERREUR (IF (VLOOKUP (B2, TaillePour Value::A:B, 2, 0) = 0, ' ", VLOOKUP (B2, TaillePour Value::A:B, 2, 0))," ")

    Select cell C2, copy

    Select cells C2 at the end of the C column, paste (or as needed)

  • Convert a numeric value to text

    First problem-

    Convert a numeric value to text

    Convert currency value in words.

    e.g. Rs. 10, 000 would become rupees ten thousand only

    RS 1,50,749.77 would become rupees one Lakh fifty eight thousand seven hundred forty-nine and seventy seven Paise only.

    Second problem-

    = SIERREUR (IF ($A16 > = $K$ 1, (INDEX (($L$1:$L$40), MATCH ($B16,($H$1:$H$40), 0))), IF ($A16 < = $I$ 1, (INDEX (($J$1:$J$40), MATCH ($B16,($H$1:$H$40), 0))), 0)))

    This formula works in Microsoft excel but displays error while being used in numbers (iwork).

    Number of formula considers only the first part. While giving the equation for the second part it gives the result as FALSE. And when used in number last 0 and support must be removed to get the result. If it is not removed form displays the error message.

    Concerning

    Nishat Gupta

    Hi John,.

    First question needs a lookup table for the translation. I did several years ago for AppleWorks and later Numbers ' 09. Take a look for her tonight.

    I think that neither SGIII nor Wayne Contello done one more early as well. Both were English/North American names and number formats, so a direct copy may not be sufficient.

    Second question:

    A lot of extra parentheses in there! They are not necessary for frame type Beach H1:H40 references. Won't it doesn't work, but they don't add noise when a man tries to ead the formula.

    Here is an example using the addresses in your formula, but omitting the function SIERREUR the part I wanted to see real results, including errors, if any.

    The formula below comes from U16. The title of the image is in U17.

    IF ($A16≥$ K$ 1, INDEX ($L$ 1: $21, MATCH($B16,$H$1:$H$21,0) $L), IF ($A16≤$ I$ 1, INDEX ($ 1 $J: $J$ 21, MATCH ($B16, $H$ 1: $H$ 21.0)), 1))

    In the selected cell (U17) tests in two IF statements returns FALSE, then the FALSE result for the second, it is what is returned.

    To add a SIERREUR function:

    SIERREUR = (formula above,0)

    Kind regards

    Barry

  • I want to create a 2 cells in demand for numbers, the 1st cell is a dropdown menu with items of text, when choosing an item, that it would be represented by a numeric value in the other cell. How can I do?

    I want to create a 2 cells in demand for numbers, the 1st cell is a dropdown menu with items of text, when choosing an item, that it would be represented by a numeric value in the other cell. How can I do?

    You can use vlookup() like this:

    (1) crate a table like this:

    the first line is a heading row

    the first column contains the same list of items in the context menu

    the second column contains the corresponding values

    name of the table 'value '.

    In another table (where the pop-up menu), you can use the table of choice of 'Value' like this:

    create a drop-down list in cell B1

    Select cell C1 and type (or copy and paste) the formula:

    = VLOOKUP (B1, Value::A:B, 2, 0)

    short hand for this is:

    C1 = VLOOKUP (B1, Value::A:B, 2, 0)

    now change the pop-up to display the value in the change of cell C1

  • How do switch you between 2 numeric values using a Boolean switch?

    Hello

    I'm a newbie to labview, so it is perhaps easy to answer.

    I would like to perform a calculation which, according to the test unit, will require a different numeric value to use in the Calc.

    I tried to use a Boolean switch to choose which constant must be used during runtime mode as well for example or 0.01 or 0.02 will be selected. The idea is to labview so insert the constant selected in the calculation and spit out the answer.

    There is only one output on the Boolean toggle switch and not of entry so that I can't work out how to do it. If there were 2 inputs and 1 output it would do the job.

    Thank you

    Andy

    Try the joint.  I have provided two methods.

  • Boolean functions accepts numeric values...

    Recently I got to know that all Boolean functions both accept numeric values. But what is the purpose of it?

    I found the exit of some random values while entering numerical values of Boolean functions...

    Thank you!!

    Best regards

    Adel SR

    srrashme wrote:

    I'm not clear. Can you please attach an example?

    What you don't understand?

    When the Boolean logic is used on integers, the logic is made on a basis by ILO.  I have to do this all the time to encode and decode data from specific protocols (some more wild than the others).  It is also necessary for many data (such as a CRC or Reed Solomon) controls and for encryption (AES, OF THE, 3DES).

Maybe you are looking for

  • 4 - 1025TU envy: how to INSTALL Windows 7 on HP Envy 1025TU expenses 4

    I'm sorry if my question published or wrong thread & wrong language... Model: HP ENVY 4 1025TU320 GB hard drive4 GB OF RAMThe operating system, it was delivered is Windows 7 / 64 bit / Home BasicIf I want to install the new copy of Windows 7 32/64-bi

  • Disable the automatic backup in Apple applications

    How can I disable the automatic backup in the Script Editor and other Apple applications? I love how the captain tells us what is good for us and allows us no easy way to change things.

  • Reference a static open VI

    Hello guys,. To open the screws dynamically, instead of Hardcoding the name VI in a constant string, I do as indicated below to keep addictive for my VI, so if someone ever delete the VI of the project, move, rename, it will create a wire broken some

  • UNABLE TO REMOVE WINDOWS HOTMAIL ACCOUNT

    UNABLE TO REMOVE WINDOWS HOTMAIL ACCOUNT... I'm trying to remove my account Hotmail/windows live ({removed email address}). When I go to http://mail.live.com/mail/CloseAccountConfirmation.aspx and him say to close my account, he said "to close your W

  • HALO 2 graphics card

    I have windows Vista Home Basic. I try to run halo2 and it wont where can I get the necessary graphics card for free?