title: generate sequence of (telephone) numbers in table in mySQL
body: <p>This is my first post/question since I couldn't find the answer to what I was looking for no matter how I searched. So here it is:</p>
  <p>I have a small table of a few hundred rows with four columns (plus id col) as seen on the example below:</p>
  <pre><code>| id | phone1 | phone2 | phone3   | phone4 |
  | 1  |059374-6|        | 065371-7 |023126-8 
  | 2  |        |026372-3| 024353-7 |
  | 3  |...
  .
  .
  .
  </code></pre>
  <p>I need to generate the sequence for all the (telephone) numbers of the specific range they belong. In other words, for the first phone number I need to retrieve the numbers:</p>
  <pre><code>059374
  059375
  059376
  </code></pre>
  <p>and consequently for the rest of the phones in the table.</p>
  <p>All the number ranges are given in the above mentioned form and do not exceed the total of 10 numbers (max is something like 099500-9). In addition, they are populated through 4 different columns, as shown in the above example, something I have solved so far by using UNION ALL (in order to put them all in one column and finally find all duplicates which is the ultimate goal).
  So, is there any elegant way to generate the numbers needed?
  I have searched many threads for similar topics but surprisingly none seem to answer my question.</p>
  <p>Finally, if there is any better way than combining all cols into one with UNION ALL and then GROUP BY col1 for finding the duplicates would be highly appreciated.</p>