How to select only the part by using the sql query

Hello

I have the task to retrieve only the integral of the input text by using the sql query.

The entry is as follows

Entry for the price setting

$12.5 (FYI without space)

$ 12.5 (FYI single space)

$ 12.5 (double space FYI)

$12.5 (FYI multiple space)

$12.5 (FYI multiple space)

Output expected of 12.5

The price is the type varchar2 column in the store_price table.

Please let me know how to achieve this.

Thanks in advance.

If this is always the case that you get a $ followed by a number of places, you can use something like:

Select to_number (ltrim ('$ 12.5',' $')) DOUBLE

or

SELECT ltrim ('$ 12.5',' $') OF double

but take care of your nls_numeric_character settings if they are defined so that, for example, a comma is the decimal separator, you will have a problem.

HTH

Tags: Database

Similar Questions

  • How to select only the URLS in the same page

    I'm used to be able to select only the URL with right click of the entire page. After reinstalling Firefox, I can't use this feature more. Please let me know what kind of add-on, I need to have. Thank you

    I looked in the Wayback Machine for an older version of this page. He said:

    Multi links allows you to open, copy or favorite of several links at the same time rather than having to do them all individually.

    To open, links copy or bookmark, you simply right-click and do to drag a rectangle around the links to the desire to act. When you release the right mouse button, you will open/copy/bookmark these links.

    Note: The Wayback Machine does not cache downloads real extension due to the limitations of robots.txt on the site of modules.

    One of these current extensions could be partial replacement:

    I have not tried any of them myself.

  • How to select only the objects in a marquee?

    I am a new user of Illustrator CS5, switching from Freehand. I'm trying to find out if there is a way to select only the objects in a marquee? In AutoCAD, you can make a selection on the left window to the right and only those objects entirely in the window are selected. If you the window right on the left all the objects that are "crossed" or affected by the window are selected. Is there a similar technique in Illustrator?

    Currently, I have to select the objects, and then go back and hold the SHIFT key to deselect the object I don't want, or lock layers to prevent additional items get selected.

    NO.

  • How to select only the last child nodes in a piece of XML via XMLTABLE?

    Hello

    I use Oracle 10.2.0.4.

    I have the following XML:
    with sd as (select xmltype('<Fruits>
                                  <Fruit>
                                    <FruitType>Apple</FruitType>
                                    <FruitSubtype>Granny Smith</FruitSubtype>
                                  </Fruit>
                                  <Fruit>
                                    <FruitType>Pear</FruitType>
                                    <FruitSubtype>Anjou</FruitSubtype>
                                  </Fruit>
                                  <Fruit>
                                    <FruitType>Pear</FruitType>
                                    <FruitSubtype>Comice</FruitSubtype>
                                  </Fruit>
                                  <Fruit>
                                    <FruitType>Plum</FruitType>
                                    <FruitSubtype>Victoria</FruitSubtype>
                                  </Fruit>
                                  <Fruit>
                                    <FruitType>Apple</FruitType>
                                    <FruitSubtype>Bramley</FruitSubtype>
                                  </Fruit>
                                </Fruits>') fruit_xml from dual)
    select *
    from   sd;
    and I want to choose the last child nodes where the FruitType is Apple or pear.

    So far, I've got:
    with sd as (select xmltype('<Fruits>
                                  <Fruit>
                                    <FruitType>Apple</FruitType>
                                    <FruitSubtype>Granny Smith</FruitSubtype>
                                  </Fruit>
                                  <Fruit>
                                    <FruitType>Pear</FruitType>
                                    <FruitSubtype>Anjou</FruitSubtype>
                                  </Fruit>
                                  <Fruit>
                                    <FruitType>Pear</FruitType>
                                    <FruitSubtype>Comice</FruitSubtype>
                                  </Fruit>
                                  <Fruit>
                                    <FruitType>Plum</FruitType>
                                    <FruitSubtype>Victoria</FruitSubtype>
                                  </Fruit>
                                  <Fruit>
                                    <FruitType>Apple</FruitType>
                                    <FruitSubtype>Bramley</FruitSubtype>
                                  </Fruit>
                                </Fruits>') fruit_xml from dual)
    select x.*
    from   sd,
           xmltable('//Fruits/Fruit[FruitType=''Apple'' or FruitType=''Pear'']'
                   passing sd.fruit_xml
                   columns fruit_type VARCHAR2(25) path '//FruitType',
                           fruit_subtype VARCHAR2(25) path '//FruitSubtype') x;
    
    FRUIT_TYPE                FRUIT_SUBTYPE
    ------------------------- -------------------------
    Apple                     Granny Smith
    Pear                      Anjou
    Pear                      Comice
    Apple                     Bramley
    but I just want to finish with the last child node by FruitType, for example:
    FRUIT_TYPE                FRUIT_SUBTYPE
    ------------------------- -------------------------
    Pear                      Comice
    Apple                     Bramley
    Is it possible to do through XMLTABLE, or I have to number each of the lines that results from (what I know how to do) and then create a group to prove XMLTABLE? The latter seems awkward to me, so I'd avoid it if possible, but if this is the way to go, I can do it.

    Thank you.

    Is it possible to do through XMLTABLE, or I have to number each of the lines that results from (what I know how to do) and then create a group to prove XMLTABLE?

    Indeed, it is a possible way:

    select x.fruit_type,
           min(fruit_subtype) keep(dense_rank last order by rn) as fruit_subtype
    from   sd,
           xmltable('/Fruits/Fruit'
                   passing sd.fruit_xml
                   columns fruit_type VARCHAR2(25) path 'FruitType',
                           fruit_subtype VARCHAR2(25) path 'FruitSubtype',
                           rn for ordinality) x
    where fruit_type in ('Apple','Pear')
    group by fruit_type
    ;
    

    Other options, should push the logic of consolidation in the XQuery:

    select x.*
    from sd,
         xmltable('/Fruits/Fruit[FruitType="Apple"][last()] |
                   /Fruits/Fruit[FruitType="Pear"][last()]'
                  passing sd.fruit_xml
                  columns fruit_type VARCHAR2(25) path 'FruitType',
                          fruit_subtype VARCHAR2(25) path 'FruitSubtype'
         ) x
    ;
    

    or,

    select x.*
    from   sd,
           xmltable('for $i in distinct-values(/Fruits/Fruit/FruitType)
                     return /Fruits/Fruit[FruitType=$i][last()]'
                   passing sd.fruit_xml
                   columns fruit_type VARCHAR2(25) path 'FruitType',
                           fruit_subtype VARCHAR2(25) path 'FruitSubtype'
                           ) x
    where x.fruit_type in ('Apple','Pear')
    ;
    

    or,

    select x.*
    from   sd,
           xmltable('/Fruits/Fruit[not(following-sibling::Fruit/FruitType=./FruitType)]'
                   passing sd.fruit_xml
                   columns fruit_type VARCHAR2(25) path 'FruitType',
                           fruit_subtype VARCHAR2(25) path 'FruitSubtype'
                           ) x
    where x.fruit_type in ('Apple','Pear')
    ;
    

    Edited by: odie_63 APR 17. 2012 17:56 - added latest example

  • It is not clear to me that my desktop images get synchronized to the mobile in Lightroom or how to select only the pictures I want to synchronize

    some clarification on this would be appreciated

    I see no advantage to have all my images Desktop Sync and that's what happened so that I stopped the synch

    Hi natureron,

    You have the choice of synchronization of specific collections you want.

    In the Panel collections, there is a sync button on the left of the collections that you can choose and set the collections that you want to synchronize.

    And the same button can be used to stop the synchronization for a specific collection.

    See this tutorial for more information on synchronization:

    How to start using Lightroom on mobile | Adobe Photoshop Lightroom CC tutorials

    How do I synchronize Lightroom desktop and mobile application of Lightroom

    Kind regards

    Claes

  • How to select only the best score?

    I have a table with notes, like this:
    Name    | Section |Score
    ----------------------
    John    | A      | 1
    John    | B      | 3
    John    | C      | 2
    Sue     | A      | 3
    Sue     | B      | 2
    Sue     | C      | 3
    Now, I want to choose the name and the average score that has the highest average score. So, in this case, the average score of John is 2 and average score of Sue is 2.6, so I want the result to be:
    Name    | Score
    -----------------------
    Sue     | 2.6
    How do I get there?

    Published by: 785131 on August 10, 2011 14:49
    PS. I don't know why, but suddenly my handle is recessed to a number, while I put a proper name for it...

    Hello

    Here's a way to do it:

    with t as (
    select 'John' as name, 'A' as section, 1 as score from dual union all
    select 'John' as name, 'B' as section, 3 as score from dual union all
    select 'John' as name, 'C' as section, 2 as score from dual union all
    select 'Sue' as name, 'A' as section, 3 as score from dual union all
    select 'Sue' as name, 'B' as section, 2 as score from dual union all
    select 'Sue' as name, 'X' as section, 3 as score from dual
    )
    select distinct
    first_value(name) over (order by avg(score) desc) max_name,
    max(avg(score)) over () max_avg
    from t
    group by name; 
    
    MAX_NAME      MAX_AVG
    ---------- ----------
    Sue        2.66666667
    

    Kind regards
    Sylvie

  • How can I write the SQL query for this requirement?

    Hello

    I have a table that looks like this:

    NAME | ANNUAL |     VALUE
    ==== | ====== | =====
    execno |     480.     000004
    step |      480.     0400
    SCNA |     480. cd_demo
    System |     480.     D47-010
    type |     480.     step
    free_text |     480.     stage 400
    rbare |     480.     RBA-1
    execno |     482. 000004
    SCNA |     482. cd_demo
    System |     482.     D47-010
    free_text |     482.     step 300
    step |          482.          0300
    type |      482.     step
    rbare |     482.     RBA-1
    execno |     483.     000001
    type |     483.     step
    rbare |     483.     rke1
    SCNA |     483.     rke10
    step |     483.     0240

    Now, say that I want to fetch ONLY annual with execno = '000004' and '400' = step and scna = "cd_demo" and system = "d47-010' and type = 'step', how to write SQL code?
    At first, it seemed like a simple writing query but I've been struggling with it for hours without success. I must admit though that I'm not strong in SQL :-)
    There, can anyone help? Please...

    Thanks in advance.

    Emmanuel

    Published by: user12138559 on October 30, 2009 03:05

    Hi, Emmanuel.

    Welcome to the forum!

    Here's a way to do what you asked:

    SELECT       doc_id
    FROM       table_x
    GROUP BY  doc_id
    HAVING       SUM (CASE WHEN name = 'execno' AND value = '000004'  THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'step'   AND value = '400'     THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'scna'   AND value = 'cd_demo' THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'system' AND value = 'd47-010' THEN 1 END) > 0
    AND       SUM (CASE WHEN name = 'type'   AND value = 'step'    THEN 1 END) > 0
    ;
    

    If you think that a WHERE clause would be used, but WHERE does apply to a single line. You need a condition that checks several rows in the same group.
    WHEN has an effect something like WHERE.

    Published by: Frank Kulash, October 30, 2009 06:26

    This solution assumes that (name, annual) is unique.

  • How to check only my laptop computer use integrated or the AMD graphics card?

    How to check only my laptop computer use integrated or the AMD graphics card? Some games show me that they use the built-in map: http://img849.imageshack.us/img849/4125/98ab1c28dc9f4b51b537435.png ?

    I have no other option. I have disable Intel card in Device Manager, and it shows me that the AMD driver is not installed correctly. Thank you.

  • How to call only the operations of several connectors of ICF through simple connector server

    Hi Experts,

    I developed two connectors of the ICF (ICF1 and ICF2) and placed the beams of connector on the same server connector.

    Please guide me how to get only the authorities of each of the connector to call operations of each separately.

    I use following code-

    List of < ConnectorInfo > this.getConnectorInfoManager = cInfos () .getConnectorInfos ();

    System.out.println (cInfos.Size ());

    for {(ConnectorInfo cInfo:cInfos)

    APIConfiguration apiConfiguration = cInfo.createDefaultAPIConfiguration ();

    setPoolConfigurations (apiConfiguration);

    Discoveryendpointspecifie configProps = apiConfiguration.getConfigurationProperties ();

    this.setUpConfigurationProperties (configProps);

    ConnectorFacadeFactory facadeFactory = ConnectorFacadeFactory.getInstance ();

    ConnectorFacade connectorFacade = (apiConfiguration) facadeFactory.newInstance;

    connectorFacade.test ();

    }

    Methods of all connectors are called here to test and how do I selectively invoke test() selective connectors?

    Hello

    The connector of the ICF is called by these configurations in the 'Lookup.CONNECTOR_NAME. Research of configuration. The search name is configured in the COMPUTER resource

    We have the following values configured in the search based on who the connector class fires is

    Name of the connector

    org.identityconnectors.CONNECTOR_NAME. Connector

    Main connector class identity. It is the class that implements the SPI of the ICF framework operations.

    Name of the bundle

    org.identityconnectors.CONNECTOR_NAME

    Name of the identity connector bundle

    In Version

    11.1.1.5.x

    Version connector identity

  • I'm trying to create one named calculation in a field, but not able to select only the required fields, other than all or not.

    Hi all

    I installed "Acrobat Standard DC".

    I've been working on a PDF file to filliable form.

    Then tried to make a calculation in a field, but wasn't able to do.

    When you set up, I was not able to select only the necessary fields.

    field-select_0.pngfield-select_1.png

    I have only be able to select all or not!

    Is that what I'm doing wrong?

    Even trying in "simplified... field. "it doesn't work.

    Thanks for any suggestions!

    Use the space bar to select a single box.

    Wednesday, July 29, 2015, at 14:16, supporth66519991 [email protected]>

  • Select only the objects in a rectangle selection

    I am a new user of Illustrator CS5, switching from Freehand. I'm trying to find out if there is a way to select only the objects in a marquee? In AutoCAD, you can make a selection on the left window to the right and only those objects entirely in the window are selected. If you the window right on the left all the objects that are "crossed" or affected by the window are selected. Is there a similar technique in Illustrator?

    Currently, I have to select the objects, and then go back and hold the SHIFT key to deselect the object I don't want, or place objects on different layers and then lock the layers to prevent additional items get selected.

    In AutoCAD, my main program, you simply draw a window selection, left or right, depending on what your next step would be. No special tools or rocking or thinking, that's just the selection primary process and very intuitive.

    I posted a discussion on the Illustrator forum several months ago, which still arouses comments so this seems to be a tool that would be appreciated by many users. Someone posted a script but it has not worked for me yet.

    Thank you for everything that you can do to solve this problem.

    This is a copy of my last post of the original thread. I found some discussions confused because I have no experience in writing or by using scripts. So I copied all the recommendations in a document to read without the comments and digressions. After several hours and a lot of searching on Google I found what solution adapted to my goal, which was a selection process fast and simple with fewer steps to use.

    So, I think I have this job. The following is what I did:

    1 copy the script by Carlos Canto post #11 here:

    http://forums.Adobe.com/thread/856221?start=0&TSTART=0

    2. open the ExtendScript Toolkit Utilities > Adobe utilities - CS5.5 > ExtendScript Toolkit CS5.5 > ExtendScript Toolkit CS5.5.App

    3. when the program opens, paste the script in the large Panel on the left.

    4. then go to file > save as.

    5. that the dialog box click on the arrow next to the save box slot to expand the section options.

    6. next, go to Applications > Adobe Illustrator CS5.1 > Presets > en_US > Scripts.

    7. then, in the Save as box enter a name to identify the script (I named mine Window1).

    8. click on save and close the Toolbox.

    Launch Illustrator and open a drawing.

    1 using the rectangle tool, I drew a rectangle around the objects.

    2. make sure that the new rectangle is selected.

    3. I went to file > Scripts > Window1.

    4A got an error message - error 8705: target layer cannot be changed 25-> iart.selected + true line:

    Oops, you must have ALL unlocked layers.

    5. you click OK.

    6 unlocked all the layers.

    7. my new activated rectangle.

    8. went to file > Scripts > Window1.

    9 here! Items in the rectangle are selected and the rectangle is removed.

    So yes, this script works as requested. Thank you, Carlos.

  • How to select a layer by name using Javascript?

    How to select a layer by name using Javascript?

    You can do this in Applescript by using this code:

    set active layer of the window active to layer "Layout" of myDocument

    I can't understand the correct syntax in Javascript.

    Someone knows how to do this?

    Any information would be greatly appreciated,

    adobeJavaScripter

    In JavaScript, you can use the following code:

    app.activeDocument.activeLayer=app.activeDocument.layers.itemByName("Layout");
    

    For "app.activeDocument", use "myDocument", if you prefer.

    Uwe

  • Filter in adobe bridge to select only the Raw files to DNG format convert

    Here's my problem - I have a new camera DMC TZ70 and 5.7 Lightroom does not recognize the. RW2 files. I would need to buy LR6! Maybe later.

    So I thought that I import via the bridge and convert to DNG.

    So I open the bridge, and then select the camera - great - BUT there are files for Raw, the same number of JPEG files images and some .bdm. TDT etc files. (for example 3 raw + 7 others).

    I can set up a filter to Show only Raw files when I see what files are in the folder of the card at the Bridge, but when I select "get photos from camera" I can either select all OR deselect and then I need to MANUALLY select raw files. There seems not to be a way to set up a filter in the form of Downloader so that bridge selects only the Raw files for conversion.

    If I left it all, Bridge Converts the RW2 in DNG files, but also provides in the JPGs and other files. I can delete these later, but this seems an inefficient way to do it.

    Is it possible to manually select raw files in the form of Photo Downloader?

    Advice please, thank you, Mel

    I guess the answer's bridge doesn't do what I want, but not Lightroom - bought LR6

  • How to select only rows with multiple records below?

    Dear all,

    My Table looks at below:

    Table structure:
    CREATE TABLE T_20 (CONTROL NUMBER(10) NOT NULL,
                           PO NUMBER(10) NOT NULL,
                           AMENDNO NUMBER(3) NOT NULL,
                           FACTOR VARCHAR2(3) NOT NULL,
                           COMMENT_X VARCHAR2(40),
                           FLAG VARCHAR2(1))
    
    
    SQL> alter table t_20 add constraint t_20_pk primary key (control, po, amendno, factor);
    INSERT orders:

    SQL> INSERT INTO T_20 VALUES(101,1000,01,'MSC','NO COMMENT','Y')
      2  /
    
    1 row created.
    
    SQL> INSERT INTO T_20 VALUES(101,1000,02,'MSC','NO COMMENT','Y')
      2  /
    
    1 row created.
    
    SQL> INSERT INTO T_20 VALUES(101,1001,00,'NDP','NO COMMENT','Y')
      2  /
    
    1 row created.
    
    SQL> INSERT INTO T_20 VALUES(101,1001,01,'NDP','NO COMMENT','Y')
      2  /
    
    1 row created.
    
    SQL> INSERT INTO T_20 VALUES(102,1002,00,'ABC','NO COMMENT','Y')
      2  /
    
    1 row created.
    out put:
    SQL> SELECT * FROM T_20
      2  /
    
       CONTROL         PO    AMENDNO FAC COMMENT_X                                F 
    ---------- ---------- ---------- --- ---------------------------------------- - 
           101       1000          1 MSC NO COMMENT                               Y 
           101       1000          2 MSC NO COMMENT                               Y 
           101       1001          0 NDP NO COMMENT                               Y 
           101       1001          1 NDP NO COMMENT                               Y 
           102       1002          0 ABC NO COMMENT                               Y 
    Now, I want to select only the control number that have several acht.

    In above example only control 101 with several PO 2 PO with 1000 and 1001
    So I need to select only this 101 related lines...

    for 102 having in. sinple folders then it will have to be removed... because I have millions of records in the primary table...
    someone you suggest query... Thank you..

    Thanks in advance
    Prasanth

    Try this

    select *
      from (
    select t.*, count(distinct po) over(partition by control) cnt
      from t_20
          )
     where cnt > 1
    
  • How to get only the whole ticks on a horizontal axis of a graph?

    Hello
    Could someone help me find oout how to get only the whole ticks on a horizontal axis of a graph?
    When I have a number less than 5, I get like 0, 0.2, 0.4 ticks... while I want it to be 0, 1, 2...

    Thank you
    Yann

    healer

    Try this Clara. Put this inbetween your chart labels:



    Set the interval to meet your needs of 'tick '.

Maybe you are looking for

  • Satellite U400-138 - how to activate special keys?

    Hello the problem for the subject [Satellite U400 - 138 Volume - software problem wheel | http://forums.computers.toshiba-europe.com/forums/thread.jspa?messageID=148001] I found a stupid bug in the software Toshiba Satellite U400-138 special keys. Th

  • Satellite A210-199 - after updating BIOS only seeing yellow on

    Hi all, help is needed. After a BIOS updated with the help of Toshiba TEMPRO laptop Satellite A210-199 stopped working. The updated spent normally, but when it was turned off is more responsible. All this time the yellow indicator Burns power only. I

  • MacBook Pro stolen by train.

    Hello world I'm posting here in the hope that there will be a little tiny thing that Apple technical team could do. My Macbook Pro was stolen on December 21 in the train. And even if I know that, apart from the option "find my mac", there is not much

  • Pavilion g150cy: RAM for g150cy 17 "laptop

    I am wanting to upgrade the RAM on my laptop.  It came with 6 GB.  Which is the maximum it can hold?  Can I get better?  I upgraded the memory on a Dell laptop.

  • How to remove the message of authentic microsoft software

    Diagnostic report (1.9.0027.0):-----------------------------------------Validation of Windows data-->Validation status: invalid product keyValidation code: 8Code of Validation caching: n/aWindows product key: *-* - XKD7P - Y47XF-P829WWindows product