SQL Code

  • Hi,,

    I wanted to know if you'll could help me with this.

    I have a table with a column addressline1 containing address starting with a number as well as letter

    9539 Glenside Dr

    1226 Shoe St.

    Gulfport Factory Shops

    Haberstr 123

    Haberstr 18

    #500-75 O'Connor Street

    #9900 2700 Production Way

    00, rue Saint-Lazare

    5415 San Gabriel Dr

    I need to select only rows that starts with a number between 0-9.

    Can anyone help me with MS SQL code. I am using version 2005

  • SELECT *

    FROM yourtable

    WHERE Address1 LIKE '[0-9]%'

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks Jeff

    Just Works fine.....really appreciate that

    🙂

  • You bet... thank you for the feedback...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply