Select from the table where the last character of the string is numeric

Hello
I have a table of STREETS with a field called ADDRESS. I want to select all the records in streets where the last character in the address is a number.
Select ADDRESS of STREETS where regexp_like (substr (address,?,?,), '[0-9]');
--? means that I don't know what to put here!

I don't know if substr is the best approach to do this, because I want only the last character and the records are of different lengths.

Thank you!

Hello

If you want to use regular expressions:

WHERE     REGEXP_LIKE ( address
              , '[0-9]$'
              )

You can get the same results, no doubt more effectively, without regular expressions:

WHERE     INSTR ( '0123456789'
           , SUBSTR (address, -1)
           )     > 0

Tags: Database

Similar Questions

  • To create an interactive report in the apex by selecting from multiple tables

    Hi, I am creating an interactive report by selecting from multiple tables.

    SELECT w.FIRST_NAME as name, w.SURNAME as name, i.ROAD Road, i.DATE_OF_INC as DATE_OF_INC, S.STATEMENT as a STATEMENT OF Declaration

    JOIN THE

    WITNESS w

    ON w.witness_id = s.FK1_WITNESS_ID

    JOIN THE

    Incident I have

    WE

    i.incident_no = w.FK1_INCIDENT_NO

    JOIN THE

    user_station ps

    ON ps.station_id = i.nearest_station_id

    JOIN THE

    the user in.

    WE

    in. STATION_ID = ps.station_id

    WHERE po.officer_id = 1

    by I continue to encounter this error "the report query requires a unique key to identify each row. The supplied key cannot be used for this query. Please change the report attributes to define a unique key column. "ORA-01445: cannot select ROWID from where sample, a join without key preserved table view '

    So I googled around and found that in the attibutres tables report, I need to change the "LINK" COLUMN so first, I changed "Link to custom target", but the report is so I changed it to "Exclude link Clolumn" again, the report didn't report and I STILL got a blank page with only the tabs.

    I wonder you can not create a report by selecting from multiple tables?

    If you can please I need your help.

    Thank you

    You can, but in this case, it might be easier to build your report tables that are joined Oracle views and then build your report out of the newly built sight...

    Or wrap a selection around your selection with joins, and then make the where clause on the external selection...

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

  • Select the last character of a string

    Hello
    I want to select the last character of a string address. "For example, as a result of select ' 165 John Ave W '-'W '. I tried to use the RIGHT but it does not work. I am using sqlplus.

    SELECT RIGHT(ADDRESS,1) FROM addresses;
    ORA-00904: "RIGHT": invalid identifier

    I can't find that any select statement to get the result I want. Ideas?

    Thank you!

    You want: SUBSTR (, - 1).

  • ORA-22992: cannot use LOB Locators selected from the remote tables...

    Oracle 10.2.1.0.4
    Solaris 10

    We try to access a table in another database via a db_link.

    The table we are trying to access has a LOB.

    We get the following error: ora-22992: cannot use LOB Locators selected from the remote tables.

    Is there a way to get around this? We need the data in the BLOB field.

    Thank you.

    See on metalink:

    ORA-22992 has a workaround solution in 10 gr 2
    DOC - ID: 436707.1

    Werner

  • I use a PC and I used LR3. I'm a newcomer to LR, so patient with me! My problem is related to the import function. I have a photo library on an external hard drive. I slowly imported previews of the photos selected from the library in

    I use a PC and I used LR3. I'm a newcomer to LR, so patient with me! My problem is related to the import function.

    I have a photo library on an external hard drive. I've slowly been import previews of the photos selected from the library in my catalog, adding them during the import process - well. But now, I hit a problem. Another folder in my library contains several subfolders, each containing a number of photos (a mixture of RAW steals (naves) and jpg). I was importing found in my catalog each Subfile in turn, using the Add function, usually of the jpgs only from each Subfile. It works fine, until I reached a particular Subfile. For some reason when I try to import from it and select the secondary file as a Source, only the RAW (NEF) images appear in the preview pane (sorry, forgot the correct term for it!). I know that jpg files are in this auxiliary file on the external hard drive, because when I view its content in Windows, they are all there. But try as I can (choose the file under source, select the folder parent as a source, try to copy or move them, instead of adding them), nothing seems to work. Since they do not appear in the preview pane, I can't import them. It does appear that this a Subfile where the problem exists, but I don't see anything that is different from the others (names of files under all use the same structure - yyyy-mm-dd_custom name, and pictures in all subfolders are adopting the same denomination structure too - yyyy-mm-dd_sequential number_custom name.) NAVE/JPG. So what I am doing wrong? Any ideas please.

    It is possible that the images in this particular subfolder were taken in your camera in RAW + JPEG.  If so, you will need to go to preferences under the general tab and make sure the box "processing JPEG files files next to raw as separate photos" is checked.

    However, assuming that this is the case, there is really no reason to import the JPEG file if you already have the RAW file.

  • Image display according to the value selected from the bean of choice

    Hello

    I have a table with columns of bean of choice and have an another bean image

    based on the value selected from the bean of choice of a particular line, I want to display an image in the column of bean image

    and it is particularly in the line, in which the user changes the value of the bean of choice.

    Please help me

    Thank you

    Hello
    H1.

    If I choose 'user' of choice its not display any image, but I need disabled display images it

    -have you set the URI of the Image of the time of the image?
    -deleteicon_enabled.gif N deleteicon_disabled.gif

    Concerning
    Meher Irk

    Published by: Meher Irk on October 24, 2010 12:18 AM

  • Mark from a table where the column value is a colon-delimited list

    Version: Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    Hello

    This is a new query of a query Frank helped me with: https://community.oracle.com/message/12506306#12506306

    Demand is all users to restrict the report based on a multiple selection on the front-end server (application APEX) filter.

    The filter returns that a colon-delimited list and the data in the table can be saved in a delimited by a colon list too. There may be 1 to n values (up to 4000 characters).

    I need a WHERE clause that will allow a match, if it exists, between the data in the column of the Table and the Mult-selection list filter.

    The abbreviated for this post query would be something like:

    SELECT slt_id, slt_item, slt_owner

    OF slt_dashboard

    WHERE slt_owner IN (colon delimited page list);

    The Create Table and Insert statements:

    CREATE TABLE slt_dashboard
    (
      dashboard_id  NUMBER,
      slt_id        VARCHAR2(10),
      slt_item      VARCHAR2(2500),
      slt_owner     VARCHAR2(4000),
      slt_type      VARCHAR2(25),
      slt_year      NUMBER,
      parent_id     NUMBER
    );
    
    --Insert slt_dashboard
    INSERT INTO slt_dashboard(dashboard_id,slt_id,slt_item,slt_owner,slt_type,slt_year,parent_id)
    VALUES (12,'1.1','Implement revenue enhancement initiatives','E15889:JPARISI:BDUR63','Business Commitment',2014,6);
    
    INSERT INTO slt_dashboard(dashboard_id,slt_id,slt_item,slt_owner,slt_type,slt_year,parent_id)
    VALUES (13,'1.2','Strengthen our Energy position','KVROMAN','Business Commitment',2014,6);
    
    
    

    I have a function to separate the list delimited by two points in a table for the IN clause, but because these values can be saved in a delimited list of Colon in the column of the Table, I have a problem, being able to analyze the data in the column, AND the filter data.

    The function is:

    CREATE OR REPLACE FUNCTION get_list( p_string IN VARCHAR2
                                        ,p_delimiter IN VARCHAR2 DEFAULT ':'
                                       )
        RETURN vc_array_1
        PIPELINED
    IS
        l_string VARCHAR2( 32000 );
        l_array wwv_flow_global.vc_arr2;
    BEGIN
        l_array     :=
            APEX_UTIL.string_to_table( p_string
                                      ,p_delimiter
                                     );
    
        FOR i IN l_array.FIRST .. l_array.LAST
        LOOP
            PIPE ROW ( TRIM( l_array( i ) ) );
        END LOOP;
    
        RETURN;
    END;
    
    
    

    The function called in the query in the form (it's just for reference in case someone wanted to know):

    SELECT ...
    FROM ...
    WHERE slt_owner IN (SELECT * FROM TABLE( get_list( :P115_SLT_OWNER ) ));
    

    But I can't use this approach because the data in the Table can be saved in a delimited list of Colon too.

    Desired output:

    If the Mult-Select list filter contains: E15889:JPARISI then

    1.1 implementation of the E15889 revenue improvement initiatives; JPARISI (it's a semicolon between the names)

    If the multiple-selection list filter contains: KVROMAN then

    1.2 strengthen our position of energy KVROMAN

    If the multiple-selection list filter contains: BDUR63:KVROMAN then

    1.1 implementation of the BDUR63 revenue improvement initiatives

    1.2 strengthen our position of energy KVROMAN

    Please let me know if something is not clear.

    Thank you

    Joe

    I went to approach the Table and the Page works perfectly.

    Thank you to everyone!

    Thank you

    Joe

  • Create the table in select * from the other table

    DB: 11.2.0.2

    How to create a table with structure only not empty the data that we do not generally create table in select * from... But the command will pull the data also. How to create without data?

    create table foo
    in select * bar
    where 1 = 0

  • Select from another table, when the query returns no result

    Hello

    I have a question where I'm supposed to retrieve the address of an account id-based billing. However, the table of billing may not have an address. There is a table of addresses that always has an address for an account. If the billing address exists, it should be used, so I can't use the address table. Is it possible in a select statement to query to the billing address and if it does not exist, use the address table.

    SELECT * FROM accounts a, b billings WHERE a.accountid = b.accountid

    Any help will be greatly appreciated.

    Thank you.

    user10407139 wrote:
    Hello

    I have a question where I'm supposed to retrieve the address of an account id-based billing. However, the table of billing may not have an address. There is a table of addresses that always has an address for an account. If the billing address exists, it should be used, so I can't use the address table. Is it possible in a select statement to query to the billing address and if it does not exist, use the address table.

    SELECT * FROM accounts a, b billings WHERE a.accountid = b.accountid

    Any help will be greatly appreciated.

    I think you need to explain more clearly if

    -you only have a couple of "billing" columns which is empty and in this case, you want to use the columns from the table 'accounts '.

    - or you have a join with another table that doesn't return data, for example a foreign key "address_id" "billing" is zero and therefore the join to other tables 'address' will return all the data

    In the first case, you have already been provided with some examples here, how to use NVL or similar functions to achieve, even if the first post first evaluates the information of 'accounts' and if it is white using information from "billing". According to your description you need the other way around. The second post a subquery recursive useless in my opinion.

    In the latter case, you should probably use an "outer" join so that the data in your table "bills" are returned, even if the join to another table is not at all the lines.

    SELECT
    NVL(AD1.ADDRESS_ATTR1, AD2.ADDRESS_ATTR1) as ADDRESS_ATTR1,
    NVL(AD1.ADDRESS_ATTR2, AD2.ADDRESS_ATTR2) as ADDRESS_ATTR2,
    NVL(AD1.ADDRESS_STREET, AD2.ADDRESS_STREET) as ADDRESS_STREET,
    ...
    FROM accounts a
    INNER JOIN billings b
    ON a.accountid = b.accountid
    LEFT OUTER JOIN address ad1
    ON b.address_id = ad1.address_id
    INNER JOIN address ad2
    ON a.address_id = ad2.address_id;
    

    In this way you pick up the address stored in the "invoices" table, if it existed, otherwise you pick up the address assigned to the "accounts" table I used an inner for the second address join join because you said that the account always has an assigned address.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • SELECT from the table during a TRUNCATION operation...

    Nice day

    Environment: Oracle 10 g 2 EE on AIX and Crystal Reports/Crystal Enterprise (XI 3.1)

    We have a table that is refreshed every 10 minutes throughout the day and night. Users run reports against the table pretty well any time they want. The table is updated through OWB by using the TRUNCATE/INSERT that first truncates the table and then reloads the entire table.

    Opportunities random when the user runs the report at the same time as the update of the table, the user gets an error message from Crystal as follows:

    Error in the file ~ tmp23206abf4faed20.rpt: impossible to extract the data from the database. Details: [database vendor Code: 8103]

    In other cases, which is the one that I expect, the user sees a report empty and all simply of runs again the report. The report only takes a few seconds.

    This error could be due to the Crystal report trying to get the data in the table at the EXACT time that the table is truncated?

    Other thoughts are welcome!

    Thank you very much!

    -gary

    Hi Gary,.

    This behavior is described in MOS 170185.1

    Concerning
    Peter

  • Script to move a selection from the limits of spread?

    I have a document with a difference much larger than the content in the document.

    1-oversize-pasteboard.png

    I have another template file with a gap corresponding to the size of the limits of all selected objects. I need to open this template, paste the objects, that pasted selection of objects align to the top left of the spread (aka cardboard neighborhood or work?) and then export as a PDF and .eps.

    Due to a lot of confusion about various coordinate systems, my ideal would be not having to move what that at all, but have instead, the upper left corner of the pasted content aligned with the upper left of the spread, as it is glued. Paste or paste in place makes the content where I need them. The objects are too weak.

    2-contents-pasted-too-low.png

    Even if there is a solution to paste the information where it needs to go from the outset, I would like to know how make a difference compared to the visible work area (I think it is properly known as the spread, but more commonly referred to as the mount table?) I want to just make sure I ask my question correctly so my intentions are understood).

    My first test with the following line of code produces the result seen in the next picture; only the background .eps object is moved, and it moves down.

    App.Selection [0]. Move([MyPage.Bounds[0]+myMargins.Top,MyPage.Bounds[1]+myMargins.Left]);

    3-first-try-to-move.png

    My second test is shown below; It seems also only reposition the background image, but something moved too far down and to the right. It seems that it may be of the same size and shape, like spread which I copied objects. The limits of selection have the right size when I stuck first the object in the new document, until the line of code to change the geometric limits has been executed.

    App.Selection [0] .geometricBounds = [myPage.bounds [0] + myMargins.top, myPage.bounds [1] + myMargins.left, myPage.bounds [2] - myMargin s.bottom, myPage.bounds [3] - myMargins.right];

    4-2nd-try-to-move.png

    Also, previous attempts (until I added the image of the Tiger, the text to its immediate left and a red rectangle behind the Tiger) saw all objects selected EXCEPT the background .eps image move upward and in the right position using app.selection [0] .geometricBounds.

    Any help would be greatly appreciated. Here is the code and a screenshot of the objects on the layer that are involved.

    indesign #target - 11.064 / / CC 2015

    myDoc = app.activeDocument;

    myPages = app.activeDocument.pages;

    myActivePage = app.activeWindow.activePage;

    // 1. Select and copy everything on this document activePage

    App.Select (SelectAll.All);

    App.Copy ();

    // 2. Open the template file and paste

    whichExportTemplate = "FCILG";

    myTemplateFolder = ' / Users/user/Documents /!  "Resources / models / Ted signs / Tags ';

    sFileName = myTemplateFolder + "/" + whichExportTemplate + ".indd".

    sFileName = sFileName.replace (/ % 20/g, "'" ");

    newDoc = app.open (File (sFileName));

    app.pasteInPlace ();

    App.Select (SelectAll.All);

    // 3. POSITION IT

    var myPage = myActivePage;

    var myMargins = myPage.marginPreferences;

    App.Selection [0] .geometricBounds = [myPage.bounds [0] + myMargins.top, myPage.bounds [1] + myMargins.left, myPage.bounds [2] - myMargin s.bottom, myPage.bounds [3] - myMargins.right];

    App.Selection [0]. Move([MyPage.Bounds[0]+myMargins.Top,MyPage.Bounds[1]+myMargins.Left]);

    // 4. Save the new file

    // 5. Close

    5-layers.png

    Would you mind bringing together all elements of the page on the page, you have a single object to process after duplication (I prefer duplicate() on app.copy () / app.pasteInPlace ()) without selecting anything? Just answer has all the elements of the page on your source page to add a group and manage this unique group object.

    Quick and dirty:

    //TWO InDesign documents are open
    //The SOURCE document is the ACTIVE one
    
    var myTargetDoc = app.documents[1];
    
    myTargetDoc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
    myTargetDoc.zeroPoint = [0,0];
    
    //Group everything on the active page of your SOURCE document:
    var myActivePage = app.layoutWindows[0].activePage;
    var myGroup = myActivePage.groups.add( myActivePage.pageItems.everyItem().getElements() );
    
    //Target the second document for the duplicate of the group:
    var myDuplicate = myGroup.duplicate(myTargetDoc.pages[0]);
    
    //Move the duplicate:
    myDuplicate.move([0,0]);
    
    //Tidy up a bit:
    myDuplicate.ungroup();
    myGroup.ungroup();
    

    Hope, that helps.

    Uwe

  • How to create a report based on the item selected from the list of selection?

    Hello

    I created a tables_LOV based on:

    Select table_name table_name user_tab_cols r, d

    where column_name like '% _type % '.

    Then I created a ListOfTables page element, display in a selection list and pointing to tables_LOV.

    I run the page, and I can choose the table I want in the drop-down list.

    How to create a report based on the selected element? (ex: select * from selected_table)

    Thanks in advance

    Salah

    Hi Salah,

    Allright, take a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report

    I think that simulates what you are trying to accomplish. I've implemented the simplest method I could think of.

    The report is based on a collection of apex. If you are not familiar with this, you should study the documentation: APEX_COLLECTION

    To recreate my example, you should:

    (1) create a report (interactive) on your collection

    SELECT *
       FROM APEX_collections
     WHERE collection_name = 'MY_COLLECTION'
    

    (2) create a selection list page_item for the tables that you want to display (in my case, this is called "P38_TABLES")

    (3) create a dynamic action that triggers on the evolution of your selection list page_item. Dynamic action must be a parade of PL/SQL procedure the following code:

    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
    
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
        );
    end;
    

    Make sure that you add your page_item 'Page to send items' section.

    (4) add a real extra action that makes an update of the report area.

    Here are two photos describing the da:

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA1.PNG

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA2.PNG

    Good luck and greetings,

    Vincent

    http://vincentdeelen.blogspot.com

  • produce a series of numbers to select from the shortcomings of the ID column

    (1)

    Suppose I have a table t that contains lines like this:

    A AND B
    ---------- ----------
    2 4
    6 7

    I would like to use select to produce lines with numbers between a column and column B included
    for each line, like this:

    Select from t...

    2
    3
    4
    6
    7

    (2)

    Suppose I have the ID column that is lacking, I want to get the lowest < N > numbers available between the gaps.
    I did some research and I can find the range of gaps, but I can't get the numbers listed separately, therefore
    I ask the question (1). But is there a direct way for the list instead of going through beaches and the list.

    For example, I have the ID column that has

    2
    5
    6
    7
    9
    2000000

    I would get a select query that produces

    Select...

    3
    4
    8
    10
    11

    I have a way to get a list of 2 to 2000000, then less than what we need to get all the
    numbers of the gap, but who is not effective and may is short-term memory.

    PS: before I post on this group, I did some research already on "connect by", with recursive queries.

    PuraVidaOTN wrote:

    I would like to use select to produce lines with numbers between a column and column B included

    for each line, like this:

    Assuming that no duplicates in the table...

    with t as
    (
     select 2 c1,4 c2 from dual union all
     select 6 c1,7 c2 from dual
    )
    select c1,c2,c1+level-1 c
    from t
    connect by c1+level-1 <= c2
    and prior c1 = c1
    and prior c2 = c2
    and prior sys_guid() is not null;
    
    C1 C2 C
    -- -- -
     2  4 2
     2  4 3
     2  4 4
     6  7 6
     6  7 7 
    

    Suppose I have the ID column that is lacking, I want to get the lowest numbers between the gaps.
    I did some research and I can find the range of gaps, but I can't get the numbers listed separately, therefore
    I ask the question (1). But is there a direct way for the list instead of going through beaches and the list.

    I have a way to get a list of 2 to 2000000, then less than what we need to get all the
    numbers of the gap, but who is not effective and may is short-term memory.

    It's the best way in my opinion...

    Or rather less, you can try outer join...

    Published by: JAC on December 19, 2012 21:28

  • In first items 14 scene selection from the Menu movie (Motion, holiday, Christmas frame) does not bind the scene 6 main Menu page. It places the scene 6 2 Menu scenes, but unrelated to the other, the main or scene selection Menu. What it

    How can I edit a movie Menu template? I use a Motion - celebrations and events - model of menu for Christmas related to 6 scene markers. Five scenes are represented by a thumbnail and name on 1 Menu scenes that appears when the button on the main menu page scene selection is reached. However, the scene 6, which has also a sticker and marker corresponding scene, is on another page (Menu 2 scenes) that does not link to the home page (does not appear in the scene selection Menu that has just 5 thumbnails and an arrow to return to the main Menu). In the area of work under the clip monitor Main Menu 1, Menu 1 and Menu 2 of scene scene appear together and by clicking on the thumbnail in the scene 2 menu the link to the clip 6 works except when Preview Disc is played, in which case the Menu 2 scene disappears. The scene marker is correctly linked, it just does not appear in the menus of the finish. The first five items of the Assembly (related to the scene selection menu) are all the video clips, but the 6th clip is a slide show. I read several threads on menus but found no mention that a slide show scene marker is treated differently by a menu template. Is it? The 5 first clips are all in the format AVI - DV with imported project files previously saved in this format, so that they could be related and engraved on a DVD. The slideshow is imported from PSE14 and 6 attached clips have already been burned successfully on disk (without menu) as a try-out. However, I was not satisfied with the resolution, then saved individually at the only other resolution DVD - SD576. Now I'm stuck at getting this sort menu. I operate 10 WIN. Any help will be accepted with gratitude.

    Hi, thanks for your response. I can rephrase the question very easily: why I've been so stupid? My problem was that I couldn't see a link in the menu between the Menu scenes 2 template and the main Menu. It turns out that the link was there all the time (a sideway arrow just above the main Menu link) but I thought he was part of the link from the main Menu and never clicked on it. When I burned my project to a disc and played on television, the sideway arrow was a different color and, of course, another link... the link I was looking for. Then, my apologies, problem solved, lesson learned - click on everything you see. Thank you. And I was very happy since the upgrade to 14 before except when it makes me feel stupid, which is frequently.

  • Notify the application that the Quit is selected from the dock icon menu

    I'm building Air application icon menu dock, is there a way for me to know if the 'Quit' from the context menu on the Dock icon is selected? I looked at the "closing" is not what I'm looking for as this is also sent when the user clicks the X button on the application.

    Thank you.

    The trick was to manage 'EXIT' event

    http://StackOverflow.com/questions/1338152/detecting-different-quit-options-in-air-applica tion on mac

Maybe you are looking for

  • stop used my Mac Pro?

    Whenever I have it hit "SHUTDOWN" my computer stops but RESTARTS immediately. I have not any open programs, and I have no timed auto-off or start enabled.

  • Some problems after the downgrade from Vista to XP - Tecra S10

    Hello I wonder if you could give me a helping hand with a laptop I bought recently. With the S10, I got a downgrade and used to downgrade to XP SP3 cd, but who has a problem.Sometimes when I restarted the pc, or even when it would boot it would hang

  • memory leak Winlogon.exe and high CPU usage

    I use Windows XP SP3. I'm leaking memory in winlogon.exe (about 5 M/hour). In addition, the CPU usage spikes to 50% of all 6 seconds. The file is properly signed so probably not a virus. This problem started after the application of last weeks patche

  • How can I buy excel

    How can I buy excel?

  • Unable to start the Base filtering engine, error 5: access denied

    I just discovered my base filtering engine service is not enabled. My antivirus (panda) and firewall (zonealarm) seem to work fine, I scanned my computer and there was no detected virus. I don't know why BFE does not work and I looked everywhere onli