Home postgresql select max no if date is same
Reply: 0

postgresql select max no if date is same

user548
1#
user548 Published in July 16, 2018, 3:08 am

i have a table like:

  sr_no    or_no     date
  1        1         2017-01-01  
  1        2         2017-02-02
  1        3         2017-02-02
  2        1         2017-01-02
  2        2         2017-01-10

What i want is if date field for a sr_no is same then record with max or_no should be fetched. Output should be like:

sr_no     or_no    date
1         1        2017-01-01
1         3        2017-02-02
2         1        2017-01-02
2         2        2017-01-10
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309841 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO