|
It is currently Wed Feb 08, 2012 5:54 pm
|
View unanswered posts | View active topics
|
Page 1 of 1
|
[ 3 posts ] |
|
| Author |
Message |
|
delta2cain1
|
Post subject: 2 D query Posted: Fri May 09, 2008 12:38 pm |
|
Joined: Fri May 09, 2008 11:48 am Posts: 2
|
|
Hi I have a table with 2 columns Name (variable type) and CODE (variable type)
I need to retrieve a result in the following format
NAME -->
CODE
| FREQUENCY
|
V
The number of names may vary
so also the code
I Need to write a query in MySQL
Please point me in the right direction.
|
|
| Top |
|
 |
|
allaboutgeo
|
Post subject: Posted: Fri May 09, 2008 6:26 pm |
|
Joined: Fri May 09, 2008 5:55 pm Posts: 11
|
|
I am unable to understand your requirement.
_________________ Geosciences
|
|
| Top |
|
 |
|
delta2cain1
|
Post subject: Posted: Mon May 12, 2008 1:38 pm |
|
Joined: Fri May 09, 2008 11:48 am Posts: 2
|
|
SELECT ABC , count(*) AS "Count", XYZ FROM profile WHERE XYZ IN (SELECT DISTINCT a.XYZ FROM profile a) GROUP BY ABC,XYZ;
gives me a table of type
ABC COUNT XYZ
a 23 z
b 45 z
c 65 z
...
a 76 y
b 56 y
...
...
a 45 x
b 46 x
etc etc
now i neet it to be put in the format
XYZ z y x .....
ABC
a 23 76 45 ...
b 45 56 46 ...
c 65 ......
. . . .
. . . .
Help Me plz
i have 3000000 + records how can i optimize the query
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 3 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|