If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > what is the use of max() function on a char field

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-10, 07:48
vikram3.r@tcs.com vikram3.r@tcs.com is offline
Registered User
 
Join Date: Aug 2009
Posts: 14
what is the use of max() function on a char field

The fields of DEPT table are ID int, Description char or varchar


what is the use/significance/advantage of using max function on a char/varchar field in the following query ?

select max(Description) from DEPT
__________________
Vikram RM
Reply With Quote
  #2 (permalink)  
Old 07-19-10, 08:56
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by vikram3.r@tcs.com View Post
what is the use/significance/advantage of ...
use:== finds highest collating description

significance:== depends on the business application whether this means anything

advantage:== easiest way to do it, built right in to SQL
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Tags
char, field, max, significance, varchar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On