Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

count record in same name condition

select  t1.candidate
from (select count(Winner_loser_indic) as win, candidate from election where Winner_loser_indic ='W' group by candidate) t1
  inner join (select count(Winner_loser_indic) as lose, candidate from election where Winner_loser_indic ='L' group by candidate) t2
     on t1.candidate = t2.candidate
where t1.win = t2.lose
 
PREVIOUS NEXT
Tagged: #count #record #condition
ADD COMMENT
Topic
Name
4+7 =