[SQL] Find the maximum between 2 fields
bahcham
Posted messages
3
Status
Member
-
abdallah_mehdoini -
abdallah_mehdoini -
Hello everyone.
I would like to know a method using SQL that allows to get the maximum between two fields in a database.
Example:
Student ........Final Control Score....... Make-up Score...... Max Score
....X ..........................10..................... 12......................... 12
....Y ...........................8....................... 7........................... 8
....Z ..........................10 ......................10 ..........................10
I would like to know a method using SQL that allows to get the maximum between two fields in a database.
Example:
Student ........Final Control Score....... Make-up Score...... Max Score
....X ..........................10..................... 12......................... 12
....Y ...........................8....................... 7........................... 8
....Z ..........................10 ......................10 ..........................10
5 answers
Hello!
I'm sorry, but since I'm not currently on a machine with Oracle, I can't run any tests. But if I were you, I'd try something with the GREATEST function.
It allows you to compare multiple values (text, date, or number).
Something like GREATEST(final_control_score, makeup_score) should work.
See you!
I'm sorry, but since I'm not currently on a machine with Oracle, I can't run any tests. But if I were you, I'd try something with the GREATEST function.
It allows you to compare multiple values (text, date, or number).
Something like GREATEST(final_control_score, makeup_score) should work.
See you!
I am looking for a function that does the same thing as GREATEST.
Thank you infinitely.