Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

Help with Greatest

Greatest returns a null.

SELECT greatest('123','456',NULL)

How can I avoid this?

Need to apply this on date fields
0
JElster
Asked:
JElster
1 Solution
 
rjohnsonjrCommented:
Try this.  Worked for me in my testing:

select greatest(d1,d2,IFNULL(d3,0)) from test1;

Open in new window

0
 
Ray PaseurCommented:
Uhh, maybe "SELECT thing FROM table ORDER BY thing DESC LIMIT 1"
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now