Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Let's use a nested select in a dynamic query for an example:

Code Block
titleStatement Dynamic query with a nested select
SELECT id, fk_id, col1 FROM testTable1 WHERE fk_id = (select id from testTable2 where col = {customfield_10000});

If the parent field does not have associated a child custom field, there is no need to use to search by primary key. This is applied only to fields with children.

For those fields, the query should look like:

Code Block
titlePrimary Key
SELECT id as pk, fk_id, col1 FROM testTable1 WHERE fk_id = (select id from testTable2 where col = {customfield_10000});