i have a table 'transaction' with columns store_name, transaction_id, and user_id. If a user has transactions in the same store multiple times in sequential order then it counts as one appearance, for example:
store A, store B, store B, store C, store B
will be list as
store A, store B, store C, store B
in addition, i want to list the user_id who have transactions in the exact following order of store_name : store A, store C, store B. I'm using the transaction_id to sort the transaction. But because my knowledge of sql is still lacking, i just wrote this query :
SELECT transaction_id, user_id, store_name
FROM transaction
WHERE store_name IN ('store A','store C','store B')
ORDER BY transaction_id;
And of course, this didn't produce the result I wanted. Can anyone help? thank you so much.