Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #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,312
Default

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

hi...

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

Bookmarks

Thread Tools

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 Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles