alexa
Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

SQL Oracle select second max [duplicate] ?

SQL Oracle select second max [duplicate] ?

try this if you want 2nd max by id_dependent

-- untested

 select id_dependent, max(data)  from 
gest  gest_out where data not in 
      (SELECT MAX (data), id_dependent 
      FROM gest gest_in where gest_out.id_dependent = gest_in.id_dependent 
      group by id_dependent) 
       group by id_dependent

226 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online