Difference between revisions of "FUNCTIONS"

From SQLZOO
Jump to: navigation, search
(Created page with "<h3>SQL Functions</h3> Standard SQL functions together with some common non-standard function. MS SQL, Oracle, MySQL and PostgreSQL provide support or have alternatives. Where...")
 
Line 5: Line 5:
 
<tr><td align='left'>[[ABS]]</td><td align='left'>[[CURRENT_TIMESTAMP]]</td><td align='left'>[[LENGTH]]</td><td align='left'>[[+ INTERVAL]]</td><td align='left'>[[SUBSTRING(ansi)]]</td></tr>
 
<tr><td align='left'>[[ABS]]</td><td align='left'>[[CURRENT_TIMESTAMP]]</td><td align='left'>[[LENGTH]]</td><td align='left'>[[+ INTERVAL]]</td><td align='left'>[[SUBSTRING(ansi)]]</td></tr>
 
<tr><td align='left'>[[AVG]]</td><td align='left'>[[DATEPART]]</td><td align='left'>[[MAX]]</td><td align='left'>[[+ (string)]]</td><td align='left'>[[SUBSTRING]]</td></tr>
 
<tr><td align='left'>[[AVG]]</td><td align='left'>[[DATEPART]]</td><td align='left'>[[MAX]]</td><td align='left'>[[+ (string)]]</td><td align='left'>[[SUBSTRING]]</td></tr>
<tr><td align='left'>[[|| (strings)]]</td><td align='left'>[[DAY]]</td><td align='left'>[[MIN]]</td><td align='left'>[[POSITION]]</td><td align='left'>[[SUM]]</td></tr>
+
<tr><td align='left'>[[More strings]]</td><td align='left'>[[DAY]]</td><td align='left'>[[MIN]]</td><td align='left'>[[POSITION]]</td><td align='left'>[[SUM]]</td></tr>
 
<tr><td align='left'>[[CASE]]</td><td align='left'>[[DIV]]</td><td align='left'>[[MINUTE]]</td><td align='left'>[[QUARTER]]</td><td align='left'>[[TAN]]</td></tr>
 
<tr><td align='left'>[[CASE]]</td><td align='left'>[[DIV]]</td><td align='left'>[[MINUTE]]</td><td align='left'>[[QUARTER]]</td><td align='left'>[[TAN]]</td></tr>
 
<tr><td align='left'>[[CAST]]</td><td align='left'>[[EXTRACT]]</td><td align='left'>[[MOD]]</td><td align='left'>[[RANK]]</td><td align='left'>[[TO_CHAR(dates)]]</td></tr>
 
<tr><td align='left'>[[CAST]]</td><td align='left'>[[EXTRACT]]</td><td align='left'>[[MOD]]</td><td align='left'>[[RANK]]</td><td align='left'>[[TO_CHAR(dates)]]</td></tr>

Revision as of 15:13, 12 July 2012

SQL Functions

Standard SQL functions together with some common non-standard function. MS SQL, Oracle, MySQL and PostgreSQL provide support or have alternatives. Where possible alternatives are given.

ABSCURRENT_TIMESTAMPLENGTH+ INTERVALSUBSTRING(ansi)
AVGDATEPARTMAX+ (string)SUBSTRING
More stringsDAYMINPOSITIONSUM
CASEDIVMINUTEQUARTERTAN
CASTEXTRACTMODRANKTO_CHAR(dates)
CEILFLOORMONTHREPLACETRIM
COALESCEHOURNULLIFRIGHTYEAR
CONCATIFNULLNVLROUND
COSINSTRPATINDEXSECOND
COUNTLEFT% MODULOSIN
CURRENT_DATELEN+(dates)SUBSTR
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense