Pl/sql query

hello guys

could you help me to solve this query in sqlserver

lets i have a table "bapi" having 6 field like this

s1 s2 s3 s4 s5
… … … … … …
M A T R I

i want to retrive all the data by using select statement and my output will be look like this:
xyz

M
A
T
R
I

Please help urgent

Thanks

sarajit

On first glance, I’d want to know why you’re looking to do something like this when it would (most likely) just be easier to do it in code. You’re going to be pulling from the same record over and over and over again. A lot a overhead for a simple operation.

Are you pulling from more than one record? Is there other data involved? All of these things have a major impact on how (or if) you could do this in a single statement.

But you could do something like this:


SELECT S1 AS xyz FROM bapi where rowID=1
UNION
SELECT S2 AS xyz FROM bapi where rowID=1
UNION
SELECT S3 AS xyz FROM bapi where rowID=1
UNION
SELECT S4 AS xyz FROM bapi where rowID=1
UNION
SELECT S5 AS xyz FROM bapi where rowID=1
UNION
SELECT S6 AS xyz FROM bapi where rowID=1
UNION
SELECT S7 AS xyz FROM bapi where rowID=1