title: List of workers that worked last week for the first time since April
body: <p>I am trying to create a list of workers that had the first shift last week since April 2021.
  At the moment with the current query made below, I generate a list of workers that had only 1 shift last week, including also those who worked between April and last week. Do you know a way to create a more accurate list?</p>
  <pre><code>WITH time_frame AS
    (SELECT date_trunc('week',NOW())-interval '1 week'),
  
  worker AS
    (SELECT DISTINCT booking.worker_id,
                     count(booking.id)
     FROM booking
     WHERE booking.start_time &gt;= '04-01-2021'
     GROUP BY 1
     HAVING count(booking.id) = 1)
  
  
  SELECT booking.worker_id
  FROM worker
  JOIN booking ON booking.worker_id = worker.worker_id
  WHERE date_trunc('week',booking.start_time) =
      (SELECT *
       FROM time_frame)
  </code></pre>