PHP MySql Web Hosting

PHP and MySQL Web Development

,ch04.13730 Page 172 Wednesday, November 29, 2000 4:43

Filed under: SQL in a Nutshell — webmaster @ 5:18 am

,ch04.13730 Page 173 Wednesday, November 29, 2000 4:43 PM Example SELECT LOWER(’You Talkin To ME?’), UPPER(’you talking to me?!’); -> you talking to me?, YOU TALKIN TO ME?! The various database vendors also support a variety of other text formatting functions that are specific to their implementation. SUBSTRING The SUBSTRING function allows one character string to be extracted from another. SQL99 Syntax SUBSTRING(extraction_string FROM starting_position [FOR length] [COLLATE collation_name]) If any of the inputs are NULL, the SUBSTRING function returns a NULL. The extraction_string is where the character value is extracted from. It may be a literal string, a column in a table with a character datatype, or a variable with a character datatype. The starting_position is an integer value telling the function at which position to perform the extract. The optional length is an integer value that tells the function how many characters to extract, starting at the starting_position. MySQL Syntax and Variations SUBSTRING(extraction_string FROM starting_position) MySQL s implementation assumes that the characters are to be extracted from the starting position continuing to the end of the character string. Microsoft SQL Server Syntax and Variations SUBSTRING(extraction_string [FROM starting_position] [FOR length]) Microsoft SQL Server largely supports the SQL99 standard, except that it does not allow the COLLATE clause. Microsoft allows this command to be applied to text, image, and binary datatypes; however, the starting_position and length represent the number of bytes rather than the number of characters to count. Oracle Syntax and Variations SUBSTR(extraction_string, starting_position [, length]) Oracle s implementation, SUBSTR, largely functions the same way as SQL99. It does not support the COLLATE clause. When a starting_value is a negative number, Oracle counts from the end of the extraction_string.If length is omitted, the remainder of the string (starting at starting_position) is returned. PostgreSQL Syntax and Variations SUBSTRING(extraction_string [FROM starting_position] [FOR length]) PostgreSQL largely supports the SQL99 standard, except that it does not accept the COLLATE clause. Functions SUBSTRING 173

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by PHP MySQL Web Hosting