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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. splitting data using sql

splitting data using sql

Scheduled Pinned Locked Moved Database
databasehelp
3 Posts 2 Posters 1 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.
  • K Offline
    K Offline
    Kunal P
    wrote on last edited by
    #1

    hi.. i needed help regarding an sql query.. i have an column.. containing alphanumeric values in this format.. no spaces.. 1213334Alsakasd12334 653453asdgsdgghj354 i want it to be split in to this type of a format as shown below colum1 column2 12312334 alksaksdf 6543534 wqeqweqe is this possible using sql in the first place.. if yes.. could anyone please help me out..

    Kunal Piyush

    M 1 Reply Last reply
    0
    • K Kunal P

      hi.. i needed help regarding an sql query.. i have an column.. containing alphanumeric values in this format.. no spaces.. 1213334Alsakasd12334 653453asdgsdgghj354 i want it to be split in to this type of a format as shown below colum1 column2 12312334 alksaksdf 6543534 wqeqweqe is this possible using sql in the first place.. if yes.. could anyone please help me out..

      Kunal Piyush

      M Offline
      M Offline
      Marcus J Smith
      wrote on last edited by
      #2

      Is there any particular length? Try the site below to see if the substring option will work but that requires that you know how much of the string you need. SQL Substring Command[^]

      SELECT SUBSTRING(ColA, 10) AS ColumnA, SUBSTRING(ColB, 10) AS ColumnB FROM TABLE


      CleaKO

      "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
      "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

      K 1 Reply Last reply
      0
      • M Marcus J Smith

        Is there any particular length? Try the site below to see if the substring option will work but that requires that you know how much of the string you need. SQL Substring Command[^]

        SELECT SUBSTRING(ColA, 10) AS ColumnA, SUBSTRING(ColB, 10) AS ColumnB FROM TABLE


        CleaKO

        "I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy
        "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)

        K Offline
        K Offline
        Kunal P
        wrote on last edited by
        #3

        the numeric length is variable.. i tried this Select left('123Delhi',Patindex('%[A-Z]%','123Delhi')-1 )Add1 , substring('123Delhi',Patindex('%[A-Z]%','123Delhi'),Len('123Delhi')) Add2 from address but i want that the pattern applies to all the columns.. also..... the result appears 4 times...mean 4 rows.

        Kunal Piyush

        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