Skip to main content

Recursive queries

  • May 31, 2013
  • 3 replies
  • 12 views

Navin_C
Forum|alt.badge.img+2
Hello All In TD the recursive queries are supported with the WITH clause, The table in the WITH clause can be referenced in the select queries after it. Do we have a feature like this in Vertica. I have checked that Vertica provides WITH clause but it has restrictions with the recursive queries inside it. My query is create local temporary table tmp_litab on commit preserve rows as( WITH tmp_with_table as (select pm_id, pm_name from tempdb.kptab UNION ALL select pm_id,pm_name,t.pm_id, t.pm_name from (WITH tmp_withs_table as (select pm_id, pm_name from tempdb.kptab)), tempdb.kptab) select * from tmp_with_table); The code does not work. Any other way we can acheive this.......

3 replies

Forum|alt.badge.img+2
  • Participating Frequently
  • June 1, 2013
Hi Navin, Unfortunately, Vertica does not currently support recursive WITH. Currently, recursion must be implemented in application logic. Adam

Mike_Day
Forum|alt.badge.img
  • Participating Frequently
  • February 25, 2015
Hi there

Is recursive WITH still unsupported?

Thanks

Siddarth
Forum|alt.badge.img+1
  • Participating Frequently
  • February 25, 2015
Yes its still not supported.