subquery_merge_nested_subquery.sql 465 B

12345678910111213141516
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. USE plato;
  4. DEFINE SUBQUERY $get_tables_list($dir) AS
  5. SELECT
  6. Unwrap($dir || "/" || CAST(TableName(Path, "yt") AS String)) AS Path,
  7. FROM FOLDER($dir)
  8. END DEFINE;
  9. DEFINE SUBQUERY $get_all_tables_list($dirs) AS
  10. $get_src_tables = SubqueryExtendFor(UNWRAP(ListUniq($dirs)), $get_tables_list);
  11. select * from $get_src_tables();
  12. END DEFINE;
  13. process $get_all_tables_list([""]);