SQL update for fetch job history details

SQL fix for server side pagination