hey hi i have table like this
a b c
1 4 7
2 5 8
3 6 9
i need that all data under a,b,c in once column of another name like this
d
1
2
3
4
5
6
7
8
9
is there any possibility to get solution means please please reply to my mail...
5 20478
try self union to show the columns in one column
Option 1:
Unpivot your data
Option 2
Use UNION ALL
Option 3
1. Concatenate your columns
2. Try doing this...
Happy Coding!!!
~~ CK
Declare @t table(a int,b int,c int) - Insert Into @t select 1,4,7 union all select 2,5,8 union all select 3,6,9
-
-
select d = a from @t union
-
select b from @t union
-
select c from @t
~~CK: How will you fit your first (Unpivot) and last Option (Concatenate your columns) in this case? Curious to know about this with working code
It might actually the longest way to do it but it will still work...
Here, try running this: -
-
with x
-
as
-
(
-
select 1 as a, 4 as b, 7 as c
-
union all
-
select 2, 5, 8
-
union all
-
select 3, 6, 9
-
)
-
select
-
d
-
from
-
(
-
select a, b, c
-
from x
-
) p
-
UNPIVOT
-
(
-
d for columnname in (a,b,c)
-
) un
-
-
The last option will work in similar manner. I can post a sample code if you want, but it could be later :)
Happy Coding!!!
~~ CK
select c1 from #ta union select c2 from #ta union select c3 from #ta
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dennis |
last post by:
In CSS3 it looks like we'll have multiple column flowing of text
(newspaper style) in which the number of columns can be determined
automatically given the available horizontal space....
|
by: Billy Jacobs |
last post by:
I am using a datagrid to display some data. I need to
create 2 header rows for this grid with columns of
varying spans. In html it would be the following.
<Table>
<tr>
<td colspan=8>Official...
|
by: David Londeck |
last post by:
I am using Visual Basic 2003 and I have written a notepad like application
using the RichTextBox control. I am having trouble trying to emulate
Microsoft Words text block copy/paste feature. In...
|
by: Jane |
last post by:
Hi,
If anyone could help me with this, I greatly appreciate it.
I would like to know how I can display data from a db in multiple
columns rather than have it displayed in 1 column per recordset....
|
by: Cezar |
last post by:
Hi,
I need to display the content of an ArrayList on multiple columns, like
data1 data2 data3 data4
data5 data6 data7 data8
----
or
data1 data3 data5 data7
|
by: Simon Harris |
last post by:
Hi All,
I have an app which requires a list of coutries to be displayed, so far I
have a datagrid which contains displays the countries Ok, along with flag
images, these are also links to my...
|
by: simchajoy2000 |
last post by:
Hi,
I am trying to use a VB.NET listview object to display information
from a datatable. I need to have two columns of information but I
don't want the user to be able to select each column...
|
by: scratchadere |
last post by:
I am tryin to partition a listbox into multiple columns.Here is the real problem.I am getting data from MS ACCESS database.I want to display it juz like how an email account displays unread messages...
|
by: ray well |
last post by:
i need to display 2 columns of data in a list box.
how would i set this up IN CODE.
say my table is tblNames, and i have 2 fields, FirstName, LastName, and want
the data to show up in 2...
|
by: Will |
last post by:
Can someone help with code to delete multiple columns from an excel
spreadsheet? I know which columns I need to delete. The code below will
delete a single column but I'm not sure how to delete...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |