BrainDump
  Home arrow BrainDump arrow Page 4 - All About SQL Functions
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Rational Software Development Conference
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

All About SQL Functions
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2007-12-17

    Table of Contents:
  • All About SQL Functions
  • More Aggregate Functions
  • STDEV
  • Scalar Functions
  • Mid(c,start[,end]
  • Round(c,decimals)

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    PCmover - $15 Off with Coupon Code CJPH7Q

    All About SQL Functions - Scalar Functions
    (Page 4 of 6 )

    Scalar functions work against one value and return one value based on the input. Aggregate functions work on a bunch of data and return one result. I understand if you fell asleep during that; I did just writing it.

    Here is a table of scalar functions.

     

    Function Name

    What it does

    UCASE(c)

    Changes a field to Uppercase

    LCASE(c)

    Changes a field to lowercase

    MID(c,start[,end])

    Extracts characters from a text field

    LEN(c)

    Returns the length of a text field

    INSTR(c,char)

    Returns the position of a character in a field

    LEFT(c,number_of_char)

    Returns the left part of text

    RIGHT(c,number_of_char)

    Returns the right part of text

    ROUND(c,decimals)

    Rounds a numeric field to a number of decimals

    MOD(x,y)

    Gives the remainder in division

    NOW()

    Returns the present system date

    FORMAT(c,format)

    Formats a field

    DATEDIFF(d,date1,date2)

    For date calculation

    UCASE(c)

    If you want make all the characters of a selected item uppercase, you can use the UCASE function, like so:


    Select UCASE('darth ladel') from Employees;

    This will return the following: DARTH LADEL

    LCASE(c)

    Likewise, you may also wish to force all of the characters to be lowercase.


    Select LCASE('Darth Brooks') from Employees;

    More BrainDump Articles
    More By James Payne


     

       

    BRAINDUMP ARTICLES

    - Outsourcing: the Hoopla, the Reality
    - MySQL Plays in the Sun
    - All About SQL Functions
    - SQL: Functioning in the Real World
    - More Advanced SQL Statements
    - Beginning SQL the SEQUEL: Working with Advan...
    - Beginning SQL
    - A Look at the VI Editor
    - A Quick Tour of Boo
    - Book Review: Open Source Licensing
    - PGP and GPG: Email for the Practical Parano...
    - Microsoft Continues War on Open Source
    - Secure Remote Desktop Sharing with VNC on Li...
    - A Look at Google Project Hosting
    - What we can Learn from Two Linux vs. Microso...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway