Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old August 6th, 2008, 06:09 AM
Member
 
Join Date: Feb 2007
Posts: 39
Default Need query.. help me any one...

Hi,

i have the table like this,

+------+-------+-----+
| city | caste | cnt |
+------+-------+-----+
| 1 | 1 | 2 |
| 1 | 2 | 3 |
| 2 | 1 | 1 |
| 2 | 2 | 2 |
| 3 | 1 | 3 |
| 3 | 3 | 1 |
+------+-------+-----+



i want to select the top caste which is having the most cnt value for the each city.


expecting output

+------+-------+-----+
| city | caste | cnt |
+------+-------+-----+
| 1 | 2 | 3 |
| 2 | 2 | 2 |
| 3 | 1 | 3 |
+------+-------+-----+

Can you any one help me...?

Thanks,
S.Ashokkumar.
Reply
  #2  
Old August 6th, 2008, 06:57 AM
Administrator
 
Join Date: Sep 2006
Posts: 11,443
Default

What have you tried so far?
Reply
  #3  
Old August 6th, 2008, 07:37 PM
samikhan83's Avatar
Member
 
Join Date: Sep 2007
Posts: 33
Default

hi...

in ur result which is caste and which is count.....
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.