1234567891011121314151617 |
- --Four SELECT statements without FROM clauses
-
- --Example 1: Testing a calculation
- SELECT 1000 * (1 + .1) AS "10% More Than 1000";
-
- --Example 2: Testing the CONCAT function
- SELECT "Ed" AS first_name, "Williams" AS last_name,
- CONCAT(LEFT("Ed", 1), LEFT("Williams", 1)) AS initials;
-
- --Example 3: Testing the DATE_FORMAT function
- SELECT DATE_FORMAT(CURRENT_DATE, '%m/%d/%y') AS 'MM/DD/YY',
- DATE_FORMAT(CURRENT_DATE, '%e-%b-%Y') AS 'DD-Mon-YYYY';
-
- --Example 4: Testing the ROUND function
- SELECT 12345.6789 AS value,
- ROUND(12345.67) AS nearest_dollar,
- ROUND(12345.67, 1) AS nearest_dime;
|