MySQL Forums
Forum List  »  New in 4.1: Subqueries

Re: Transpose row into column
Posted by: sai ram
Date: April 24, 2005 11:32PM

Let me give another scenario to make things clear.,

Say there are 3 retail outlets A, B, C

They deal with item of code 100,101,102

Each item has different MRP,Discount percent,SalesPerDay

I have normalized my table like this

ItemCode Retail MRP Disc SalesPerDay

101 A 30 2 10
101 B 32 2 8
101 C 30 2.5 9
102 A 31 2.5 10
102 B 32 2 8
102 C 30 3.5 9


Now I need to display like this

A B C StdDev
MRP DISC SalesPerDay MRP DISC SalesPerDay MRP DISC SalesPerDay
101 30 2 10 32 2 8 30 2.5 9 0.4356
102 31 2.5 10 32 2 8 30 3.5 11 0.6455


Sorry about the alignment.,I aligned it .,But in this forum they remove the tabs..,

Just copy and paste in a notepad and provide a tab between each data.,

StdDev is a field which is calculated from value SalesPerDay of A,B,C

I read about sas with mysql.But i don't know much details

Any help would be appreciated.

Thanks brian for your response

Options: ReplyQuote


Subject
Views
Written By
Posted
57175
April 21, 2005 01:25AM
29155
April 23, 2005 11:23PM
Re: Transpose row into column
25838
April 24, 2005 11:32PM
42730
May 12, 2005 05:26AM
24828
November 21, 2005 10:16AM
18337
October 09, 2006 01:46AM
21406
January 04, 2007 05:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.