I need to specify in the select statement that the USER_1 field is not equal to 'STD'.
I tried first putting it in the where clause but get an error stating that the multipart statement could not be identified.
How can I specify this in the following select statement?
asked Aug 07 '12 at 12:54 AM in Default
It looks like you have two different questions. The first, how to ensure USER_1 is not equal to 'STD' you do this:
Obviously I have substituted a table where yours would go.
You can't filter data in the SELECT clause. That is what the WHERE clause is for. If you're getting an error that the name doesn't exist, it suggests that you may have a problem in the code elsewhere.
The second question is around the MAX statement. You will have to make that a part of a GROUP BY query for it to work.