Maybe I don't get the problem, but if your values are always 10 digits, then you could do something where you fetch all records with
1230000000<= x <=1239999999
User Profile
Collapse
-
Dynamic ORDER BY clause
Hi, I have a fairly simple select statement, but I want to do pagination and the sort order should be controlled by the user. The last part is causing me problems...
I use DB2 8.2.3 on Windows. My idea is to create a prepared statement (or a named query) instead of using dynamic SQL.
SELECT * FROM (SELECT ROWNUMBER() OVER(
ORDER BY CASE CAST(? AS SMALLINT)
WHEN 1 THEN a.firstname
WHEN 2 THEN a.lastname...
No activity results to display
Show More
Leave a comment: