Hi,
MAX is a scalar function which gives the maximum value out of the column it is applied on. For a numeric column I understand how it can work but how MAX work on a CHAR column?
And what is the column has both numbers and characters.
Making MAX function work on CHAR column.
Re: Making MAX function work on CHAR column.
This kind of function is not based on the human interpretation of the data but the underlying encoding - EBCDIC on the mainframe. If your encoding was like this:
then 9 would be less than 3 because x'30' is less than x'36'
Code: Select all
x'30' represents human 9
x'31' represents human 8
x'32' represents human 7
x'33' represents human 6
x'34' represents human 5
x'35' represents human 4
x'36' represents human 3
etc
Regards
Nic
Nic
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute