473,651 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multi row to one row separate column also

1 New Member
Now i have a MSSQL table, Material

The fields are as below,

Type, Mat_Name, Size1, Size2, Size3
A, Wood, 100, 100, 100
A, Iron, 200, 200, 200
A, Steel, 300, 300, 300
B, Plastic, 400, 400 ,400
B, Ore, 500, 500, 500
B, Glass, 600, 600, 600

Can i display them as below?

A, Wood, 100, 100, 100, Iron, 200, 200, 200, Steel, 300, 300, 300
B, Plastics, 400, 400, 400, Ore, 500, 500, 500, Glass, 600, 600, 600

Seeking help from publics, thanks
Oct 16 '13 #1
2 1372
Rabbit
12,516 Recognized Expert Moderator MVP
Your thread has been moved to the SQL Server forum.

Not easily. Depending on what version of SQL Server you have, you can use XML path or you will need to use a cursor.
Oct 16 '13 #2
ck9663
2,878 Recognized Expert Specialist
Here are some options...

Good Luck!!!


~~ CK
Oct 16 '13 #3

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

Similar topics

0
1339
by: Michelle Stone | last post by:
I have several Data Adapters, and depending on certain conditions, I set one of them as the DataSource for a datagrid on my web form. In each of the data adapters, I have the primary key of the respective tables SELECTed in the select-queries, so that I may use that field as the DataKeyField of my datagrid. But when I set the dataset produced from my data adapter
0
1498
by: Ted Timmons | last post by:
The text in my column headers is too long to fit on one line. Is there a way to make the column headers wrap to more than one line? Presently the text is cut off at the preset column width.
1
2200
by: J L | last post by:
Is it possible to create multi-line column headers for the listview control? If so, how? TIA, John
5
5750
by: bobwansink | last post by:
Hi, I'm relatively new to programming and I would like to create a C++ multi user program. It's for a project for school. This means I will have to write a paper about the theory too. Does anyone know a good place to start looking for some theory on the subject of multi user applications? I know only bits and pieces, like about transactions, but a compendium of possible approches to multi user programming would be very appreciated!
2
5191
by: Marco | last post by:
Is there a way to get the text in a column header to wrap to multiple lines? I'm using vb.net 2003.
2
1750
by: manonbar | last post by:
I have a radiobuttonlist bound to a dataset on the Page Load event, it has about 150 items. I used two columns from my SQL Server database, ItemVal for the DataValue field and ItemText for the DataText field. However my database has a third column which includes a comment (nvarchar(50)) field, ItemComment. I would like this to appear next to the given text in the radiobuttonlist as a separate column. I would like the column to be either an...
6
4077
by: gunanallasamy | last post by:
hi Folks, i came across a situation for which still i couldn't get a solution. i have table like below(some other columns are also there) option value ------- ------ 100 1 101 200
3
2974
by: tc3driver | last post by:
Hello Folks, I have an interesting problem, let me start off with, this database is not of my design, is an absolute mess, and there is nothing I can do about it. SELECT distinct(`Tickets`.`EffectiveId`), `Tickets`.`Subject`, `Tickets`.`Created`, `Transactions`.`OldValue`, `Transactions`.`NewValue`, `Transactions`.`Created` as `Tcreated`, `ObjectCustomFieldValues`.`Content` as `sev`, `ObjectCustomFieldValues`.`Content` as `tt` from...
1
1385
by: Nishant Gaurav | last post by:
Hi All, Here is the scenario i want a solution for. i have two columns col1 and col2 which needs to access the result of same table whose col(say time col) is required for fetching the result. while i want the output of col1 when time col value is equal to some value say 30 and col2 to be when time col <=30. Please let me know if this can be achieved. Thanks and Regards
0
8792
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8694
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8457
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.