You need to group by event_text, not obj_text:
 
select source_id ,event_text,count(*) from event_loc 
group by source_id,event_text;
 
 
> Date: Tue, 8 Feb 2011 16:31:39 +0530
> From: adarsh.sha...@orkash.com
> To: mysql@lists.mysql.com
> Subject: Group By Problem
> 
> Dear all,
> 
> I stuck around one more simple problem today.
> 
> I have a table named *event_loc* having below data : ( It has many 
> columns but I show you main columns that I needed )
> 
> _*Tables Data :-*_
> 
> *source_id event_text*
> 
> 1233 meet
> 1233 meet
> 1345 ends
> 1345 ends
> 1111 performs
> 13456 Minister
> 1233 Argentina
> 1233 meet
> 1345 ends
> 1555 is
> 
> As described above there are more than 100000 rows and I want my output as :
> 
> _*Output Needed :-*_
> 
> *source_id event_text Count*
> 
> 1233 meet 3
> 1233 Argentina 1
> 1345 ends 3
> 1111 performs 1
> 13456 Minister 1
> 
> 
> I tried the below query :
> 
> *select source_id ,event_text,count(*) from event_loc group by 
> source_id,obj_text ;*
> 
> But displays only unique record_id rows but I want as mentioned output.
> 
> Failed to achieve the mentioned output.
> 
> 
> Thanks & Regards
> 
> Adarsh Sharma
                                          

Reply via email to