I have the following problem, which may (I hope) have a standard solution.
I have a Java application that interacts with a database and builds SQL strings dynamically.
So far, I assume that the usual stuff.
Sometimes I have to sort the data and I use ORDER By . I still think. Problem: I sometimes have to sort by a column that has no actual data, and a short row that is the key to the actual data.
I mean:
SELECT FROM MYTable WHERE MyTable.col1 = 'A' ORDER BY MyTable.col2 ASC
And col2 has values: AB , BY , CY , which return the sorted ones, but are useless to me, since they are keys to the actual values ββfrom the properties file and therefore the final result is not sorted.
What is the best way to solve this problem according to how it currently works?
source share