I created a table for my cellphone contacts and I want to sort the cellphone numbers. Example if the phone number starts with 1 to 3 it belongs to the first telecommunications company and 4 to 6 belongs to other.
What I want to do is if the user enters their phone number the number will be inserted to the table of the telecom company but each telecom company is dependent on the ContactId which is the primary key in cellphoneContacts table.
I already tried using cellnum1 but nothing works
cellnum1 ENUM('1%','2%','3%') .............
cellnum1 VARCHAR(11) CHECK (cellnum1 IN ('1%','2%','3%')) .........
cellnum1 VARCHAR(11) CHECK (cellnum1 LIKE('1%','2%','3%'))
Where X from SUBSTR is howmany characters do you want. And please, be more specific with what you want in the future. :)