Results 1 to 3 of 3

Thread: MySQL query

  1. #1
    Join Date
    Dec 2007
    Location
    ~
    Beans
    314
    Distro
    Ubuntu 10.04 Lucid Lynx

    MySQL query

    Hi,
    I wanted to know how can I query a string such that it does not contain a slash at the end?

    right now i was trying
    Code:
    select string_data from table_of_data where string_data not rlike "/$";
    but this does not work!

    what would the right form of the query be?

  2. #2
    Join Date
    Jun 2008
    Location
    California
    Beans
    154
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: MySQL query

    You might need to escape it, by using a "\", i.e., like this "\/$", otherwise it might be getting interpreted as something else. Haven't tested it, but speaking based on my experience with other scripts/languages.

  3. #3
    Join Date
    Nov 2009
    Beans
    1,081

    Re: MySQL query

    NOT LIKE '%/' should work. No need for ^, $ in LIKE syntax; they're implicit; and % is basically '.*'.

Tags for this Thread

Bookmarks

Posting Permissions

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