Mysql: Order by Replace ()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bill

    Mysql: Order by Replace ()

    Thanks to a kind member of this group I was able to write a
    select that ignored "The " in a field:
    ORDER BY REPLACE(kennel_ name,'The ','')
    and it works fine.

    I did check the mysql documentation site, but couldn't find this
    use of replace.

    What I want to do now is ignore "The " and "A " in a select, ie:
    replace both "The " and "A " with "".

    What would be the correct syntax ?

    bill
  • Jerry Stuckle

    #2
    Re: Mysql: Order by Replace ()

    bill wrote:
    Thanks to a kind member of this group I was able to write a select that
    ignored "The " in a field:
    ORDER BY REPLACE(kennel_ name,'The ','')
    and it works fine.
    >
    I did check the mysql documentation site, but couldn't find this use of
    replace.
    >
    What I want to do now is ignore "The " and "A " in a select, ie: replace
    both "The " and "A " with "".
    >
    What would be the correct syntax ?
    >
    bill
    comp.database.m ysql.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Toby A Inkster

      #3
      Re: Mysql: Order by Replace ()

      bill wrote:
      ORDER BY REPLACE(kennel_ name,'The ','')
      >
      What I want to do now is ignore "The " and "A " in a select, ie:
      replace both "The " and "A " with "".
      ORDER BY REPLACE(REPLACE (kennel_name,'T he ',''),'A ','')

      You might also want to include "An " on your list.

      --
      Toby A Inkster BSc (Hons) ARCS
      Contact Me ~ http://tobyinkster.co.uk/contact
      Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

      * = I'm getting there!

      Comment

      Working...