title: Postgresql multiple conditional where clause with different limits
body: <p>I need to fetch data from a table with multiple if conditions. I have 3 tables: Questions, levels, difficulty_levels using which I need to fetch the data.</p>
  
  <p>EG:
  <code>Select * 
  from questions q 
  join level l on l.id = q.level_id
  join difficulty_level dl on dl.id = q.difficulty_level_id
  where:
  1. difficulty_level = 'easy', limit l.easy_question_count
  2. difficulty_level = 'medium', limit l.medium_question_count
  3. difficulty_level = 'hard', limit l.hard_question_count
  and l.id = some_id</code></p>
  
  <p>Is there a way in which I can fetch the data in a single query?</p>