473,387 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Converting the ROW values as Columns

Hai all,
I have a table like below.(with the column headings are column1 and column2)
Column1 Column2
id 2
Name xyz
Class 10
id 3
Name pqr
Class 10
id 5
Name def
Class 10

So for this above table i want the OutPut as below.
id Name Class
2 xyz 10
3 pqr 10
5 def 10

can any one help me how i will get this.
Apr 10 '14 #1
3 1182
Rabbit
12,516 Expert Mod 8TB
That's impossible to do unless you have some sort of unique sequential number to put each row in the original source in the right order.
Apr 10 '14 #2
Thanks Rabbit for your response.
So is it possible if the 'id' values are in sequence order.
If possible how i can get.
Actually for my output i made a query using the 'PIVOT' function,but
it displays the output as
id Name Class
2 xyz 10

(OR)

id Name Class
5 def 10

Because the 'PIVOT' function is want the Aggregate function.so that's why it giving the details for id=2 or id=5
Not showing the entire values what i want.
so can you please tell me for getting the all values if the 'id's are in sequence order.
Apr 11 '14 #3
Rabbit
12,516 Expert Mod 8TB
If you have an ID in sequential order, you join the table to itself 3 times on the ID to the next ID in the sequence.
Apr 11 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Carl | last post by:
Hi, I have found a way to map attributes (columns) to column headings. But this runs really slow. Is there a way to improve it? Thanks, Carl <?xml version="1.0" encoding="utf-8" ?>...
6
by: teddysnips | last post by:
I have a table called WorkItem. It models a chunk of work done during a working day. It has two columns that I'm interested in: Start (smalldatetime) - the TIME the work block is begun...
1
by: Ramakrishnan Nagarajan | last post by:
Hi, I am converting Excel data into a Dataset in C#. There are around 24 columns in the Excel Sheet. First I tried to insert one row with correct values in the Excel sheet. i.e. for text columns...
7
by: Tor Aadnevik | last post by:
Hi, I have a problem converting values from Single to double. eg. When the Single value 12.19 is converted to double, the result is 12.1899995803833. Anyone know how to avoid this? Regards...
0
by: methexandude | last post by:
Hi, I have recently started developing ASP.net applications using VB.net. Well, I created this huge query to retrieve data from SQL Server and create a pivot table, which means I'm creating columns...
2
by: =?Utf-8?B?Z2FuZQ==?= | last post by:
Hi, In a gridview, How can i display different columns between item and edit modes. For eg. i have a sql that returns productname, categoryname, etc. In viewmode, i need to display only...
21
by: py_genetic | last post by:
Hello, I'm importing large text files of data using csv. I would like to add some more auto sensing abilities. I'm considing sampling the data file and doing some fuzzy logic scoring on the...
3
by: Shivakumar | last post by:
Dear Friends, I want to show columns into rows. For example, I have a table, TIMESHEET, with the following structure: CREATE TABLE TIMESHEET ( EMPNO CHAR(3), WEEKEND_DATE DATE,...
1
by: PW | last post by:
Hi, When I run the following command, some fields are ending up blank when the clearly have values them in Excel. I have tried converting the columns to general and text. The ones that are...
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
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...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.