[Solved] MYSQL 5.6 get latest data of each student

Sam Asks: MYSQL 5.6 get latest data of each student
My Database table is as shown below. I need to get latest mark of each student. Latest entry is the row with maximum udate and maximum oder. (The oder will be incremented by one on each entry with same date)


enter image description here

In my example, I have two students Mujeeb, Zakariya and two subjects ENGLISH, MATHS. I need to get latest mark of each student for each subject. My expectd result is as follows


enter image description here

My sample data is

Code:
  DROP TABLE IF EXISTS `students`;
  CREATE TABLE IF NOT EXISTS `students` (
    `uid` int(11) NOT NULL AUTO_INCREMENT,
    `udate` date NOT NULL,
    `oder` int(11) NOT NULL,
    `name` varchar(20) NOT NULL,
    `Subject` varchar(20) NOT NULL,
    `mark` int(11) NOT NULL,
    PRIMARY KEY (`uid`)
  ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;


  INSERT INTO `students` (`uid`, `udate`, `oder`, `name`, `Subject`, `mark`) VALUES
  (1, '2021-08-01', 1, 'Mujeeb', 'ENGLISH', 10),
  (2, '2021-08-01', 1, 'Zakariya', 'ENGLISH', 20),
  (3, '2021-08-10', 2, 'Mujeeb', 'ENGLISH', 50),
  (4, '2021-08-11', 2, 'Zakariya', 'ENGLISH', 60),
  (5, '2021-08-02', 1, 'Mujeeb', 'ENGLISH', 100),
  (6, '2021-08-03', 1, 'Zakariya', 'ENGLISH', 110),
  (7, '2021-08-10', 1, 'Mujeeb', 'ENGLISH', 500),
  (8, '2021-08-11', 1, 'Zakariya', 'ENGLISH', 600),
  (9, '2021-08-01', 2, 'Mujeeb', 'MATHS', 100),
  (10, '2021-08-01', 2, 'Zakariya', 'MATHS', 75),
  (11, '2021-08-10', 3, 'Mujeeb', 'MATHS', 50),
  (12, '2021-08-11', 3, 'Zakariya', 'MATHS', 60);

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.