Home sql fetch one record per date from table
Reply: 0

sql fetch one record per date from table

user479
1#
user479 Published in May 27, 2018, 11:32 pm

I have a table like:

o_id  order_no   date        etc....
 4     1         2017-02-01
 4     2         2017-02-01
 4     3         2017-02-01

what i want is only one(highest order no) record per date should be fetched. For example for only order_no 3 for o_id 4 should be fetched

Output:

o_id       order_no      date
4          3             2017-02-01
2          1             .........so on
You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO