title: Convert a query from MySql to SQLite
body: <p>Please help to change the below MySQL query to SQLite</p>
  
  <pre><code>SELECT 
      DISTINCT t.arabic_term AS t__1,
      SUBSTR(t.definition, 1, 60) AS Definition,
      Sum(if(t3.is_main="y", 1 ,0)) AS t3__5
  FROM term t 
  INNER JOIN term_disease t2 ON (t2.disease_id = t.term_id) 
  INNER JOIN term_disease_symptom t3 ON (t3.disease_id = t2.disease_id)
  WHERE (t3.symptom_id in ( 45378 , 45351, 5546 ) AND t2.gender != 1  AND t2.active = 1 )
  GROUP BY t3.disease_id
  ORDER BY t3__5  desc;
  </code></pre>