473,401 Members | 2,146 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,401 software developers and data experts.

how to split single row into multiple columns in mysql

Hi,

I have one problem in mysql.
how to split single row into multiple columns in mysql.
my table structure:

Expand|Select|Wrap|Line Numbers
  1. id         salaryhigh salarymedium  salarylow
  2. **********************************************
  3. 1           1000          100             1
  4. 2           2000          200             2   
I need following output :

Expand|Select|Wrap|Line Numbers
  1. id      saldetails  description
  2. ***********************************
  3. 2         1000       high  
  4.           100        med
  5.            1          low
  6. 3        2000       high
  7.           200        med
  8.           2          low
Mar 20 '08 #1
1 4138
r035198x
13,262 8TB
Hi,

I have one problem in mysql.
how to split single row into multiple columns in mysql.
my table structure:

Expand|Select|Wrap|Line Numbers
  1. id         salaryhigh salarymedium  salarylow
  2. **********************************************
  3. 1           1000          100             1
  4. 2           2000          200             2   
I need following output :

Expand|Select|Wrap|Line Numbers
  1. id      saldetails  description
  2. ***********************************
  3. 2         1000       high  
  4.           100        med
  5.            1          low
  6. 3        2000       high
  7.           200        med
  8.           2          low
You can concat the columns but I don't know if you can get them to show on multiple lines using MySQL only.
Mar 20 '08 #2

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

Similar topics

0
by: Adam Fortuno | last post by:
Was in the midst of doing something today and I attempted to drop a number of columns in a table with the following: ALTER TABLE tmp DROP COLUMN col_1, col_2, col_3, col_4; Unfortunately MySQL...
1
by: mia456789 | last post by:
I hv a mysql db in my RH linux , there is a very large table in the db , the file size is about 2G , how can I split the file into two files - two files physically and one file logically ? is ...
4
by: DG | last post by:
Hi, Can anyone advise how to execute multiple statements in a single query batch. For example- update customers set customer_name = 'Smith' where customer_name = 'Smyth'; select * from...
2
by: dineshbajaj | last post by:
Hi Everybody, I need to split an image file(*.jpeg) programmatically to nine or more equal parts. Since, the code is meant to run on Windows Pocket PC 2002, I can only use methods supported...
7
by: Peter | last post by:
Gday, I have a dataset with multiple tables, from which I want to access a single value in one of those tables. I know I can do something like: Decimal myVar =...
5
by: BMeyer | last post by:
I have been losing my mind trying to parse an XML document (with nested child elements, not all of which appear in each parent node) into a DataGrid object. What I want to do is "flatten" the XML...
7
by: Daz | last post by:
Hi. I am trying to select data from two separate MySQL tables, where I cannot use join, but when I put the two select queries into a single query, I get an error telling me to check my syntax. Both...
3
by: Bill Nguyen | last post by:
I'm working on a project that requires outputs to be sent to multiple windows on a single monitor. I have no idea whether .NET can provide this capability. Also, is there any utility/control out...
4
by: dreaken667 | last post by:
I have a MySQL database containing 16 tables of data. Each table has a different number of columns and there are few common field names accross tables. I do have one master table with which I connect...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
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...
0
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...

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.