I have multiple N1QL for Analytics queries that calculate stats on data in the bucket. Is there way to have all queries in one place to execute at once instead of executing each query individually? Something like stored procedure or view in sql when I am able to gather and structure results in one spot? Thank you.
SELECT q1, q2, q3
LET q1 = (SELECT …),
q2 = (SELECT …),
q3 = (SELECT …);
I have a lot of queries and they all deep nested. Ideally I wanted to keep queries not in C# code, but stored somewhere in couchbase similar to how views and stored procedures reside in SQL Server.
Couchbase Analytics currently does not provide storage for user-defined queries.
Keep your eye on this ticket, as it’s something that will be eventually added to Couchbase Server, at least for N1QL (not sure about Analytics) - https://issues.couchbase.com/browse/MB-7591
“syntax error - at LET”,
Post the complete query and CB version, Service name.