LETTING & LET Clause


#1

Hi,

Can anybody please give an example for these two clauses. I did not understand the use of LETTING & LET clause. Please give a simple example and the usage.

Regards,
Abdul Rahim


#2

Hi Abdul,

LET and LETTING bind variables to expressions:

FROM `beer-sample`
LET uname = UPPER(name)
SELECT uname
LIMIT 10;


#3

Abdul,
Gerald has given you a good explanation.
LETTING is similar and does the same as above (for the Having/Group By clauses)

One minor addition - use backtick for the bucket (keyspace) name beer-sample (since it has a hyphen - special character)
For some reason the webpage does not display the backtick (I’m sure it was the same that happened when Gerald typed the syntax)