we a phonenumber field in our database and I would like to do a simple lookup query like:
SELECT * FROM TABLE WHERE Phonenumber = '555123456'
Since I don't know what RDBMS you're looking for, I'll give the most generic way:
phonenumber like '%5%5%5%1%2%3%4%5%6%'
This assumes that all phone numbers are at least equal length (in digits).