123456789101112131415161718192021 |
-
- --A SELECT statement that uses the LEFT function
- SELECT vendor_contact_first_name, vendor_contact_last_name,
- CONCAT(LEFT(vendor_contact_first_name, 1),
- LEFT(vendor_contact_last_name, 1)) AS initials
- FROM vendors;
-
- --A SELECT statement that uses the DATE_FORMAT function
- SELECT invoice_date,
- DATE_FORMAT(invoice_date, '%m/%d/%y') AS 'MM/DD/YY',
- DATE_FORMAT(invoice_date, '%e-%b-%Y') AS 'DD-Mon-YYYY'
- FROM invoices
- ORDER BY invoice_date;
-
- --A SELECT statement that uses the ROUND function
- SELECT invoice_date, invoice_total,
- ROUND(invoice_total) AS nearest_dollar,
- ROUND(invoice_total, 1) AS nearest_dime
- FROM invoices
- ORDER BY invoice_date;
|