Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How Max work on CHAR colmn

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Ashsih

New User


Joined: 20 Dec 2007
Posts: 29
Location: India

PostPosted: Sat Jan 26, 2008 4:55 pm    Post subject: How Max work on CHAR colmn
Reply with quote

how MAX on a CHAR column work?
Wha will be result of query if contain both number and charcter.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10255
Location: italy

PostPosted: Sat Jan 26, 2008 5:11 pm    Post subject: Reply to: How Max work on CHAR colmn
Reply with quote

it depends ...

in a plain ebcdic environment letters come before numbers
max("A","Z","0","9") will be "9"
min("A","Z","0","9") will be "A"

in an ascii environment the other way around
max("A","Z","0","9") will be "Z"
min("A","Z","0","9") will be "0"

also remember that in an ebcdic environment the letters are not contiguos

there are also other concerns.:
...strict non_strict equality
in a strict equality "AA " will be different from "AA"

... case sensitivity
Back to top
View user's profile Send private message
Ashsih

New User


Joined: 20 Dec 2007
Posts: 29
Location: India

PostPosted: Sat Jan 26, 2008 5:22 pm    Post subject:
Reply with quote

Thanks!!!!!!!!!!!
Supposed i am using DB2 and my colm has follwing valuse then what will be the o/p of MAX query.

ABC
A23
23A
999

o/p - ?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Jan 27, 2008 2:04 am    Post subject:
Reply with quote

Hello Ashsih,

Your answer was given above - in ebcdic, numbers are "higher" than letters.

In your example data, 999 would be the highest.
Back to top
View user's profile Send private message
Ashsih

New User


Joined: 20 Dec 2007
Posts: 29
Location: India

PostPosted: Mon Jan 28, 2008 10:06 am    Post subject:
Reply with quote

Thanks!!!!!!!
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jan 28, 2008 9:23 pm    Post subject: Reply to: How Max work on CHAR colmn
Reply with quote

You're welcome icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts conversion from char to packed decimal Musab Ahmed DFSORT/ICETOOL 7 Fri Apr 08, 2016 1:12 pm
No new posts Converting field from char to number danylele74 DB2 4 Tue Mar 29, 2016 4:24 pm
No new posts What is the maximum number of sort wo... Pravina M SYNCSORT 2 Mon Mar 14, 2016 4:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us