Query for Finding rates for different phone numbers
Hi, I have never written this kind of query, and I don't have any idea where to begin. Some help would be appreciate.
What I have: I have a table with country name, country code, city code, and rate per minute, type (international or local).
I want to make a query which displays the total rate based on where they call and how many minute they used.
1)The problem with this is Some of the country code and city code are anywhere between 1-5 digits. Also, the phone numbers are 7-10 digits.
2) Some country code matches other country code first digit. example. Russia country code = 7, Australia= 715 (these are just examples)
3) Same thing with city codes. example: Russia country code = 7, cities codes in russia = 9, 906, 905, 912.
And I don't want duplicate records.
I did made a query i will post it soon as I find it where I store it and edit this.
How Do I write query about finding rates?
I made previous topic. Looks like it was confusing so giving it one last final try to explain it better.
I want to find a total price of calls based on different rates * minutes called.
The problem is I have over 100+ different countries each with different country code ( 1-5 digits) and each country with different city code ( again 0-5) digits.
So How do I tell query that this is where city code starts and this is where phone number starts? because like I said each country and city codes have different length of digits.