Comparison Functions,Tests, Branching : Define Function « Function « SQL / MySQL

Home
SQL / MySQL
1.Aggregate Functions
2.Backup Load
3.Command MySQL
4.Cursor
5.Data Type
6.Database
7.Date Time
8.Engine
9.Event
10.Flow Control
11.FullText Search
12.Function
13.Geometric
14.I18N
15.Insert Delete Update
16.Join
17.Key
18.Math
19.Procedure Function
20.Regular Expression
21.Select Clause
22.String
23.Table Index
24.Transaction
25.Trigger
26.User Permission
27.View
28.Where Clause
29.XML
SQL / MySQL » Function » Define Function 
Comparison Functions,Tests, Branching
       

COALESCE(x, y, z, ...)         Returns the first parameter that is not NULL.
GREATEST(x, y, z, ...)         Returns the greatest value or greatest character string.
IF(expr, val1, val2)           Returns val1 if expr is true; otherwise, val2.
IFNULL(expr1, expr2)           Returns expr2 if expr1 is NULL; otherwise, expr1.
INTERVAL(x, n1, n2, ...)       Returns if x<n1; if x< n2, etc.; all parameters must be integers, and n1 < n2 < ... must hold.
ISNULL(x)                      Returns or 0, according to whether x IS NULL holds.
LEAST(x, y, z, ...)            Returns the smallest value or smallest character string.
STRCMP(s1, s2)                 Returns if s1=s2 in sort order, -if s1<s2, if s1>s2.

   
    
    
    
    
    
    
  
Related examples in the same category
1.Define function in C and call by SQL
2.Arithmetic Functions
3.Calculating, Formatting, and Transformation Functions
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.