SELECT
CAST(purchase_price AS FLOAT64)
FROM
'peppy-generator-406617.customer_data.customer_purchase'
ORDER BY
CAST(purchase_price AS FLOAT64) DESC
I tried to get the purchase price in ascending order but I got syntax error. I could not understand the reason for getting the error. Need help to understand the mistake.
SELECT CAST(purchase_price AS FLOAT64) AS x1 FROM 'peppy-generator-406617.customer_data.customer_purchase' ORDER BY x1 DESC