英文:
Expected end of input but got keyword ORDER in Bigquery Sandbox?
问题
当我执行
SELECT
purchase_price
FROM
my-project-a-392201.customer_data2.customer_purchase
LIMIT 1000
ORDER BY
purchase_price DESC
我得到
>语法错误:预期输入的结束但在[5:1]处得到关键字ORDER
为什么会发生这种情况?
英文:
When I execute
SELECT
purchase_price
FROM
`my-project-a-392201.customer_data2.customer_purchase` LIMIT 1000
ORDER BY
purchase_price DESC
I get
>Syntax error: Expected end of input but got keyword ORDER at [5:1]
Why is this happening?
答案1
得分: 1
正确的语法是在“ORDER BY”之后使用“LIMIT”。
SELECT purchase_price
FROM my-project-a-392201.customer_data2.customer_purchase
ORDER BY purchase_price DESC
LIMIT 1000;
英文:
The correct syntax has Limit following Order By
SELECT purchase_price
FROM my-project-a-392201.customer_data2.customer_purchase
ORDER BY purchase_price DESC
LIMIT 1000;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论