Closed richard457 closed 3 years ago
I'm not exactly sure what you are trying achieve based on your example documents (they seem circular), but JOINS are generally done like this:
SELECT b.name FROM a JOIN b ON a.docId=b.docId WHERE a.table = "a" AND a.docId = "13"
As there are no tables in couchbase lite and you select from the same database, the values in FROM and JOIN clauses are simply aliases.
In other words:
SELECT * FROM table AS a WHERE a.docId = 13
is the same as SELECT * FROM a WHERE a.docId = 13
or SELECT * WHERE docId = 13
In SQL terms think of it as a JOIN on the same table, where the table being the whole database.
Thank you so much for helping me out on Query, this was a lifesaver to me as I couldn't get my head around the Couchbase Query, I really appreciate your help. @Rudiksz
I am trying to do a simple Join of two table how Can I do that.