PHP MySql Web Hosting

PHP and MySQL Web Development

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

Filed under: SQL in a Nutshell — webmaster @ 2:38 am

,ch04.13730 Page 184 Wednesday, November 29, 2000 4:43 PM Table 4-8: MySQL-Supported Functions (continued) Function substring_index (str,delim,count) substring(str,pos) substring(str FROM pos) sum(expr) tan(X). time_format (time,format) time_to_sec(time) to_days(date) trim([[BOTH | LEADING | TRAILING] [remstr] FROM] str) truncate(X,D) ucase(str) upper(str) unix_timestamp( ) unix_timestamp(date) user( ) system_user( ) session_user( ) version( ) week(date) week(date,first) weekday(date) year(date) yearweek(date) yearweek(date,first) Description Returns the substring from string str after count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (counting from the right) is returned. Returns a substring from string str starting at position pos. Returns the sum of expr. Note that if the return set has no rows, it returns NULL. Returns the tangent of X, where X is given in radians. This is used like DATE_FORMAT( ), but the format string may contain only those format specifiers that handle hours, minutes, and seconds. Other specifiers produce a NULL value or 0. Returns the time argument, converted to seconds. Given a date, returns a daynumber (the number of days since year 0). Returns the string str with all remstr prefixes and/or suffixes removed. If none of the specifiers BOTH, LEADING, or TRAILING are given, BOTH is assumed. If remstr is not specified, spaces are removed. Returns the number X, truncated to D decimals. If D is 0, the result has no decimal point or fractional part. Returns the string str with all characters changed to uppercase according to the current character set mapping (default is ISO-8859-1 Latin1). If called with no argument, returns a Unix timestamp (seconds since 1970-01-01 00:00:00 GMT). If UNIX_ TIMESTAMP( ) is called with a date argument, it returns the value of the argument as seconds since 1970-01-01 00:00:00 GMT. These functions return the current MySQL username. Returns a string indicating the MySQL server version. With a single argument, returns the week for date, in the range 0 to 53. (The beginning of a week 53 is possible during some years.) The two-argument form of WEEK( ) allows the user to specify whether the week starts on Sunday (0) or Monday (1). Returns the weekday index for date (0 = Monday, 1 = Tuesday, . . . 6 = Sunday). Returns the year for date, in the range 1000 to 9999. Returns year and week for a date. The second argument works exactly like the second argument to WEEK( ). Note that the year may be different from the year in the date argument for the first and the last week of the year. Oracle SQL Supported Functions Table 4-9 provides an alphabetical listing of the SQL functions specific to Oracle. 184 Chapter 4 SQL Functions

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