Description
Create default bucket, primary index and put some documents in it like the following:
{"join_yr":2010, "name": "Bob"} {"join_yr":2011, "name": "Alice"}then create index on join_yr and run the following query:
with with_table as (select * from default d0 where join_yr == 2010 order by meta(d0).id limit 1) select * from default AS table1 inner join with_table as table2 on (table1.join_yr == table2.d0.join_yr)
in this query we are aliasing the with clause table (with_table) as table2 and default bucket as table1. In the result set, each document has table1 and table2 appended to each other but also has the with clause table (with_table) appended. So each document has 3 tables appended.