SUBSTRING
LEFT
RIGHT
Returns the leftmost n characters.
LEFT(str, n)
Enter values below to update the example in real time.
product_code
category_code
products
SELECT LEFT(product_code, 3) AS category_code FROM products;