Categories
SQL

SQL Select leftmost or rightmost characters from rows of data

SELECT left(item_num, 4) FROM flowers;

If item_num = 754861 then the output will be: 7548

SELECT right(item_num, 4) FROM flowers;

If item_num = 754861 then the output will be: 4861