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

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -