I'm having trouble getting this subquery to work? I've seen posts where they have exactly the same subquery as this one, but theirs works and mine does not.
Example
:SELECT X, Y, Z FROM TABLE WHERE X = (SELECT MAX(X) FROM TABLE)
Could it be because X in my example was aquired using Row_Number() OVER(Partition By X Order by Y) as X
Is there a different DB2 specific issue regarding this type of subquery?
Or am I simply misunderstanding/using bad examples to create this subquery.
Here is the error in question An unexpected token "SELECT MAX(X) FROM TABLE" was found following HERE X =(". Expected Tokens may include: "<from_clause>".
Thank you!