1

Say I have a table with columns C and D (among others but these are the relevant ones) with the date type.

I am instructed to update the values in C to be 90 days before its corresponding value in D, or the current date, whichever is later.

I'm given the hint that it "will be useful to search for the Oracle function that determines the maximum value in a series. Hint: it is not max(), which is an aggregate function!"

I have no idea what this function is and would appreciate any help!

1 Answer 1

4

The function is called GREATEST()

GREATEST returns the greatest of a list of one or more expressions. Oracle Database uses the first expr to determine the return type. If the first expr is numeric, then Oracle determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that data type before the comparison, and returns that data type. If the first expr is not numeric, then each expr after the first is implicitly converted to the data type of the first expr before the comparison.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.