I have a list of tariffs to apply to a phonenumber. The tariffs are dependent on the prefix of the phonenumber - which can be variable in length.
So I have a table containing the phone number and a table containing the prefix .... how do I do a join on this?
So I have 012160909808, field2, field3, field4 in the phonenumber table to join to 0121 in the tariff table.
I want to do something like
SELECT table1.phonenumber, table2.prefix
from table1, table2
WHERE phonenumber is like 'prefix%'
But this doesn't work for obvious reasons...
Any ideas how I would go about this? [sig][/sig]
So I have a table containing the phone number and a table containing the prefix .... how do I do a join on this?
So I have 012160909808, field2, field3, field4 in the phonenumber table to join to 0121 in the tariff table.
I want to do something like
SELECT table1.phonenumber, table2.prefix
from table1, table2
WHERE phonenumber is like 'prefix%'
But this doesn't work for obvious reasons...
Any ideas how I would go about this? [sig][/sig]