I’m looking for a way to print all the phone numbers (10 digit number) in collumn Phone_num of table Customer that has digit 5 6 7 in 5th 6th 7th position in the whole number, using SELECT FROM WHERE format.
>Solution :
You want to use the SUBSTRING function in the WHERE clause. Different databases have slightly different syntax, so you will need to look up the syntax of your database.
In SQL Server, you could write:
select phone_num from customer where substring(phone_num, 5, 3) = '567'