title: Delete with subquery using jooq
body: <p>I would like to use jooq to process this SQL instruction (listName is a List &lt; String >) :</p>
  
  <pre class="lang-sql prettyprint-override"><code>DELETE FROM table_calendar cal
  WHERE cal.client_id
  IN (
  SELECT client.id FROM table_client client
  JOIN cal 
  ON cal.client_id = client.id
  WHERE client.name = :listName )
  </code></pre>
  
  <p>I wrote this proposal : </p>
  
  <pre class="lang-java prettyprint-override"><code>    SelectConditionStep&lt;Record1&lt;String&gt;&gt; res = create.select(CALENDAR.CLIENT_ID)
                          .from(CALENDAR)
                          .join(CLIENT)
                          .on(CLIENT.ID.eq(CALENDAR.ID))
                          .where(CLIENT.NAME.in(listName));
  
      Query deleteQuery = create.delete(CALENDAR)
                      .where(CALENDAR.ID.in(res.getBindValues()));
  
      create.batch(deleteQuery).execute();
  </code></pre>
  
  <p>is it a correct approach?</p>