title: Staggered/phased/conditional SQL building in jOOQ
body: <p>Is there a way to build SQL in phases/stages using jOOQ? Something like:</p>
  
  <pre><code>        DSLContext create = DSL.using(conn, SQLDialect.MYSQL);
          DSL dsl = create.from(table("links"));
          if( !StringUtils.isEmpty(place) ) { // place is specified, change the query
  
              long placeId = getPlaceId();
  
              if (placeId &gt; 0) {
                              dsl = create.from(table("place_links"))
                              .join(table("links"))
                              .on(field("links.id").equal(field("place_links.link_id")))
                              .where(field("place_links.place_id").equal(placeId));
              }
          }
  
          String sql = dsl.select(field("*"))
                 .orderBy("links.score")
                 .limit(1)
                 .getSQL();
  </code></pre>
  
  <p>The above won't compile but I am looking for something on similar principles. I need to start with <code>from</code> since the target table changes at runtime.</p>
  
  <p>The requirement is that the final query changes at runtime depending on values which are fed in.</p>