Select U.user_id, U.Username, U.timestamp, U.account_type
From users U
Where U.user_id IN (Select T.user_id
From txnlog T
Where T.result = 'Cash Paid'
Group By T.user_id)
This is the code that I am working with. I don't know where i'm going wrong but PHPAdmin keeps telling me that I have a syntax error. I have copied the error below.
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Select T.user_id
I have no idea why this isn't working. When i use Where U.user_id IN ('1','2','3') it works... Please help
From txnlog T
From users U
Where U.user_id IN (Select T.user_id
From txnlog T
Where T.result = 'Cash Paid'
Group By T.user_id)
This is the code that I am working with. I don't know where i'm going wrong but PHPAdmin keeps telling me that I have a syntax error. I have copied the error below.
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Select T.user_id
I have no idea why this isn't working. When i use Where U.user_id IN ('1','2','3') it works... Please help
From txnlog T