This is a rather complicated MySQL query for me.
I have a table of phone numbers in the format of an American phone number 8153216458.
Example:
TABLE: numbers(number)
4512163215
4512158211
4512110579
8812163215
9405462136
3021548641
I want a list of available area codes (how I sell numbers) without repeating them. Some queries that are based on the first three digits and finally are ordered correctly.
Output:
302
451
881
940
Any solution? I don't mind if he still uses php manipulation.
thank
source
share