Write Java Code to execute SQL Group By -
we typically write oracle sql find max salary of every employee in each department if had table empid, deptid, salary:
select empid,deptid, rank over(partition deptid order salary) rnk table rnk=1; or
select empid table1 salary =(select max(salary) table2 group deptid , table2.deptid = table1.deptid ) if above table file instead, how can write custom java code implement same behavior?
if got question right, why don't implement reading file , passing library of choice querying? or using hibernate, , passing read file as:
session.createsqlquery(fromreadfile) and
session.createsqlquery(fromreadfile).uniqueresults() to results list or particular object?
Comments
Post a Comment