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. how split function work in sql [modified]

how split function work in sql [modified]

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelp
2 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.
  • F Offline
    F Offline
    findtango
    wrote on last edited by
    #1

    hi plzz tell me, if any one use split function in sql server 2000 i want to split one column data and then get coresponding values from another table like:- table_1 year code 2001 1,2,6 2002 2,5,6 table_2 code name 1 one 2 two 5 five 6 six i want to split code on(,)but this query is not working. "select name from table_2 where code=(split(select code from table_1 where year='2001'))" plzz help me thanks in advance john -- modified at 11:16 Wednesday 7th March, 2007

    M 1 Reply Last reply
    0
    • F findtango

      hi plzz tell me, if any one use split function in sql server 2000 i want to split one column data and then get coresponding values from another table like:- table_1 year code 2001 1,2,6 2002 2,5,6 table_2 code name 1 one 2 two 5 five 6 six i want to split code on(,)but this query is not working. "select name from table_2 where code=(split(select code from table_1 where year='2001'))" plzz help me thanks in advance john -- modified at 11:16 Wednesday 7th March, 2007

      M Offline
      M Offline
      Mark J Miller
      wrote on last edited by
      #2

      SQL Server doesn't have a SPLIT function, you have to write it yourself. Check out my article on using table-valued functions to create tables from string data. http://www.codeproject.com/cs/database/TableValuedFnsAsArrays.asp[^]

      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