Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL Query

 
Krish Khan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone..

I am poor in writing sql queries so i need help...


in my table i have two columns like: team and result_code
team is simple name of different teams, whereas in result_code i have repetation of four types of values like rpc, tpc,npc and sis

Now i need to display team and its relative count of 'rpc' that each team has...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on Swing. For more information, please read this.

This post has been moved to a more appropriate forum.
 
Pawan Komaram
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
select team, count(result_code) as reputation where result_code = 'rpc' group by team;
 
Pawan Komaram
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
select team, count(result_code) as reputation from mytable where result_code = 'rpc' group by team;
 
Krish Khan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not just for rpc but i need to get count for tpc too which is in same column.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic