Write a where statement to list every instance of a table that has the integer 2 in the third place from the left of the sku attribute
SELECT * FROM TABLE WHERE sku LIKE ‘__2%’;
LIKE is used in a WHERE clause to search for a specific pattern in an attribute.
The _ is a wildcard used along with LIKE statement in SQL.This will search for the presence of single character.
The two underscores followed by 2indicates integer 2 in the third place from the left . The % character indicates that any sequence character can follow that.
Another example:
WHERE EMPID LIKE '_00%' Selects any values that have 00 in the second and third positions.
Get Answers For Free
Most questions answered within 1 hours.