Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Posts
    164

    Unanswered: delete from certain point.

    How would I be able to delete everything after the "/" from a sample column listed below. Everything from the "/" and after in not suppose to be in the column.


    Column A

    A32916/917
    A33649/650
    DUPONT2/10/0
    A37154/37152
    A37154/37152
    A35419/35422

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    String handling functions in SQL are pretty engine specific. Since you regularly post in the MS-SQL forum, I'll assume that is what you plan to use, so I'd suggest:
    Code:
    SELECT Left([Column A], CharIndex([Column A], '/') - 1)
       WHERE [Column A] LIKE '%/%'
    -PatP

  3. #3
    Join Date
    May 2004
    Location
    Redwood Shores, CA
    Posts
    68

    Oracle sql

    If I did it in Oracle I would have used UPDATE instead of SELECT.

    Now in SQL server it may be different.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    LOL

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    May 2004
    Location
    Redwood Shores, CA
    Posts
    68
    r937
    Glad you liked it.
    I looked at your rudy.
    You the Shit.

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    thank you

    nicest compliment i've had all week

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •