Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-03-27 : 04:49:16
|
| DECLARE @t TABLE( ID INT IDENTITY, data VARCHAR(20))INSERT INTO @t(data) SELECT 'Ashish'INSERT INTO @t(data) SELECT 'Gilhotra'declare @i int,@cnt intselect @cnt= max(len(data)) from jacob3set @i=0while (@i <= @cnt-1)Beginselect substring(data,len(data)-@i,1) from @tset @i=@i+1ENDgothen i like to know that how to get results in a Single line of this query,,,its give resuts in different result set,,,i want it in single line... |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-03-27 : 05:10:21
|
| Thanks But i don't found how to do this?can u do it for me? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-03-27 : 05:24:32
|
[code]DECLARE @t TABLE( ID INT IDENTITY, data VARCHAR(20))INSERT INTO @t(data) SELECT 'Ashish'INSERT INTO @t(data) SELECT 'Gilhotra'SELECT Data, REVERSE(Data)FROM @t[/code] E 12°55'05.63"N 56°04'39.26" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-03-27 : 05:30:27
|
quote: Originally posted by ashishashish DECLARE @t TABLE( ID INT IDENTITY, data VARCHAR(20))INSERT INTO @t(data) SELECT 'Ashish'INSERT INTO @t(data) SELECT 'Gilhotra'declare @i int,@cnt intselect @cnt= max(len(data)) from jacob3set @i=0while (@i <= @cnt-1)Beginselect substring(data,len(data)-@i,1) from @tset @i=@i+1ENDgothen i like to know that how to get results in a Single line of this query,,,its give resuts in different result set,,,i want it in single line...
Is this related to your question in this thread?http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=122506MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|