I have a listing of all consumer purchases where some consumers make many purchases over the time frame in scope. I'd like to populate a column with the location of each consumer's first purchase but I'm getting this error:
Error in SQL statement: ParseException:
mismatched input '(' expecting <EOF>(line 2, pos 25)
== SQL ==
SELECT consumer_id
,location OVER(partition BY table.consumer_id) AS first_purchase_site
---------------------^^^
FROM table
For clarity, here is my query:
SELECT consumer_id
,location OVER(partition BY table.consumer_id) AS first_purchase_site
FROM table
WHERE consumer_purchase_order_sequence = 1