Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Splitting Hour
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

RammohanB
Starting Member

India
9 Posts

Posted - 12/11/2012 :  11:15:06  Show Profile  Reply with Quote
select name, date, hour from pathlist
where date = '2012-12-09'

In the above query i need to split hour column data from hour 1 to hour 24 which is 24 columns..


Thanks,
Rammohan

Rammohan

RammohanB
Starting Member

India
9 Posts

Posted - 12/11/2012 :  11:15:36  Show Profile  Reply with Quote
I need to seperate hours using ,

Rammohan
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/11/2012 :  11:25:06  Show Profile  Reply with Quote
Can you post a sample of your data in the pathlist table and the corresponding output you want to see?
Go to Top of Page

RammohanB
Starting Member

India
9 Posts

Posted - 12/11/2012 :  11:37:21  Show Profile  Reply with Quote
name hour date
IMO 9.10.11.12.13.14.15.16.17.18.19.20.21.22 2012-12-09


i want to split hour using . in hour column, so i have 14 hours and i need to show data as 14 columns using hour and name,date are same

Rammohan
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2241 Posts

Posted - 12/11/2012 :  23:58:15  Show Profile  Reply with Quote
Follow this link to split single column into multiple columns

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=180401

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000