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. Difficult Select Query

Difficult Select Query

Scheduled Pinned Locked Moved Database
questiondatabase
3 Posts 3 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.
  • D Offline
    D Offline
    Dimitris Sakellariou
    wrote on last edited by
    #1

    Hi, i want to get data from table, which has data like that: ColA ColB 1 12.324.145 2 425.152.643 3 12 After Select the results must be like: 1 12 1 324 1 145 2 425 ... 3 12 How can i do this?

    C A 2 Replies Last reply
    0
    • D Dimitris Sakellariou

      Hi, i want to get data from table, which has data like that: ColA ColB 1 12.324.145 2 425.152.643 3 12 After Select the results must be like: 1 12 1 324 1 145 2 425 ... 3 12 How can i do this?

      C Offline
      C Offline
      Corporal Agarn
      wrote on last edited by
      #2

      Do a search on split procedures.

      Mongo: Mongo only pawn... in game of life.

      1 Reply Last reply
      0
      • D Dimitris Sakellariou

        Hi, i want to get data from table, which has data like that: ColA ColB 1 12.324.145 2 425.152.643 3 12 After Select the results must be like: 1 12 1 324 1 145 2 425 ... 3 12 How can i do this?

        A Offline
        A Offline
        Abdulnazark
        wrote on last edited by
        #3

        create table #tmp (ColA varchar(2),ColB varchar(100)) insert into #tmp select '1', '12.324.145' union all select '2', '425.152.643' union all select '3', '12' select a.ColA,t.c.value('.','varchar(100)') as col2 from (select cola,cast(''+replace(colB,'.','')+'' as xml) as c2 from #tmp) a cross apply c2.nodes('/t') t(c)

        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