I have a a table which has the following columns:
PART_NUMBER
RESULT_TYPE
.....
There are 10-15 different "result types", i.e. -1, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9...
What I want is to produce the following type of output:
PART_NUM -1 0 1 2 3 4 5 ......
========= == == == == == == ==
PART1 12 9 23 12 4 8 34
PART2 42 4 21 32 9 1 14
.....
Thanks 2 5697
On Jun 4, 2:00 pm, whitsey <lysterfiel...@gmail.comwrote:
I have a a table which has the following columns:
PART_NUMBER
RESULT_TYPE
....
There are 10-15 different "result types", i.e. -1, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9...
What I want is to produce the following type of output:
PART_NUM -1 0 1 2 3 4 5 ......
========= == == == == == == ==
PART1 12 9 23 12 4 8 34
PART2 42 4 21 32 9 1 14
....
Thanks
What you are looking for is called a 'pivot query'.
Have a look at this page on Chris Eaton's blog: http://blogs.ittoolbox.com/database/...ot-query-12757
or search this groups archive on google with search key: pivot+rielau
HTH.
--
Jeroen
On Jun 4, 11:44 pm, Jeroen van den Broek
<nlt...@baasbovenbaas.demon.nlwrote:
On Jun 4, 2:00 pm, whitsey <lysterfiel...@gmail.comwrote:
I have a a table which has the following columns:
PART_NUMBER
RESULT_TYPE
....
There are 10-15 different "result types", i.e. -1, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9...
What I want is to produce the following type of output:
PART_NUM -1 0 1 2 3 4 5 ......
========= == == == == == == ==
PART1 12 9 23 12 4 8 34
PART2 42 4 21 32 9 1 14
....
Thanks
What you are looking for is called a 'pivot query'.
Have a look at this page on Chris Eaton's blog:http://blogs.ittoolbox.com/database/.../pivot-query-1...
or search this groups archive on google with search key: pivot+rielau
HTH.
--
Jeroen- Hide quoted text -
- Show quoted text -
Exactly what I was looking for.
thanks Jeroen This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Debbie Davis |
last post by:
Hi there,
SQL 2000
I have the following query:
SELECT sponsor, COUNT(sponsor) * 2 AS total FROM Referrals
GROUP BY sponsor
Works great, returns the sponsor and the total * 2 of their...
|
by: Rigga |
last post by:
Hi,
I am new to mysql and need help on how to join tables. I have a database
which contains 4 tables, the main table contains information by date order
and the other 3 contain data also in date...
|
by: signaturefactory |
last post by:
I am trying the following query in and oleDbCommand:
SELECT PartLocations.LocationName, Sum(PartsJournal.Quantity) AS
SumOfQuantity, PartsJournal.PartsLotNumber
FROM PartLocations INNER JOIN...
|
by: jane |
last post by:
HI,
I was ask to do a query to get the member active condition
I had table to show the member number and active status in three
month.
ACC A1 A2 A3
---- -----------...
|
by: Mike MacSween |
last post by:
tblProductions one to many to tblEvents
tblEvents contains StartDate
I want a report where the data are grouped by tblProductions.ProdID, and
sorted by the earliest date in each Production.
...
|
by: jjturon |
last post by:
Can anyone help me??
I am trying to pass a Select Query variable to a table using Dlookup
and return the value to same select query but to another field.
Ex.
SalesManID ...
|
by: clare at snyder.on.ca |
last post by:
I have a SQL query I need to design to select name and email addresses
for policies that are due and not renewed in a given time period. The
problem is, the database keeps the information for every...
|
by: Shiriah |
last post by:
I feel that this is a rather trivial concept that I cannot quite wrap my head around to make work in PHP. I consider myself an intermediate user in SQL (both MSSQL and MySQL) and somewhat novice in...
|
by: colin spalding |
last post by:
How do I design a totals query that instead of the following result
YearOfAcc PremiumGBP
2004 9,142,306.95
2004 1,481,153.21
2005 11,981,987.85
2006 20,653,195.20
2006 ...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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: 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...
|
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: 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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |