It is currently Wed Feb 08, 2012 5:54 pm

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: 2 D query
PostPosted: Fri May 09, 2008 12:38 pm 
Offline

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
 Profile  
 
 Post subject:
PostPosted: Fri May 09, 2008 6:26 pm 
Offline

Joined: Fri May 09, 2008 5:55 pm
Posts: 11
I am unable to understand your requirement.

_________________
Geosciences


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 12, 2008 1:38 pm 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 2 hours [ DST ]


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

Search for:
Jump to:  
cron