SELECT LEFT('MySQL LEFT', 5);
SELECT LEFT('MySQL LEFT', 9999);
SELECT LEFT('MySQL LEFT', NULL);
SELECT productname, LEFT(productDescription, 50) summary FROM products;
SELECT LEFT(productdescription, 50) FROM products;
SELECT REVERSE(LEFT(productdescription, 50)) FROM products;
SELECT LOCATE(' ',REVERSE(LEFT(productdescription, 50))) first_space_pos FROM products;
SELECT IFNULL(NULLIF(LOCATE(' ', REVERSE(LEFT(productDescription, 50))), 0) - 1, 0) FROM products;
SELECT productDescription, (50 - IFNULL(NULLIF(LOCATE(' ', REVERSE(LEFT(productDescription, 50))), 0) - 1, 0)) last_space_pos FROM products;
SELECT productDescription, LEFT(productDescription, last_space_pos) FROM (SELECT productDescription, (50 - IFNULL(NULLIF(LOCATE(' ', REVERSE(LEFT(productDescription, 50))), 0) - 1, 0)) last_space_pos FROM products) AS t;