Description
SELECT month, COUNT(*) AS order_count
|
FROM orders AS o
|
GROUP BY DATE_PART_STR(o.order_date, "month") AS month; |
|
This is a valid query in Analytics, but in N1QL I would have to write it as follows:
|
|
SELECT DATE_PART_STR(o.order_date, "month") AS month, |
COUNT(*) AS order_count
|
FROM orders AS o
|
GROUP BY DATE_PART_STR(o.order_date, "month"); |
|
I don't like having to write the expression DATE_PART_STR(o.order_date, "month") twice--that's what aliases are for. Do you think that N1QL users would appreciate aliases in the GROUP BY clause, as in Analytics? |
|