title: How to put condition in sql query
body: <p>I want to show all scored records in score table and student name in student table if column "flag" equal "shown". Else, if column "flag" in Score table equal "hidden" I will show all scored records with student name = "Student". Finally show all that in order of time.</p>
  
  <p>Here is what I tried:</p>
  
  <pre><code>select s.student_name if h.flag = 'shown', select 'student' as s.student_name if h.flag = 'hidden',
     h.subject1_score,
     h.subject2_score,
     h.subject3_score,
     h.subject4_score,
     h.subject5_score,
     h.exam_date
  from Score_Table h
  join Student s on h.student_id = u.student_id
  order by h.exam_date 
  </code></pre>
  
  <p>But that doesn't seem to work. What should I change?
  Thank you!</p>