Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. split string in MySQL

split string in MySQL

Scheduled Pinned Locked Moved Database
databasemysqlquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    Hi, I want to know how can I split spilt in MySQL stored procedure. I have this string Jassim Loves Banana I want to split it by space and add x to it so it will be xJassim xLove xBanana

    B 1 Reply Last reply
    0
    • J Jassim Rahma

      Hi, I want to know how can I split spilt in MySQL stored procedure. I have this string Jassim Loves Banana I want to split it by space and add x to it so it will be xJassim xLove xBanana

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      use replace as

      SELECT REPLACE('Jassim Loves Banana', ' ', ' x');


      I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.

      J 1 Reply Last reply
      0
      • B Blue_Boy

        use replace as

        SELECT REPLACE('Jassim Loves Banana', ' ', ' x');


        I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.

        J Offline
        J Offline
        Jassim Rahma
        wrote on last edited by
        #3

        one more question please.. if I have the string as

        jassim rahma

        or

        jassim ali rahma

        or anything else how can split that to be:

        <pre>SELECT file_no, old_file_no, account_number, id_number, full_name, date_of_birth FROM patients WHERE MATCH(full_name) AGAINST('jassim' WITH QUERY EXPANSION) and MATCH(full_name) AGAINST('rahma' WITH QUERY EXPANSION) ORDER BY full_name;</pre>

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups