Showing entries 1 to 1
Displaying posts with tag: Geeky (reset)
Sorting US Address Data.

So, in Europe the street name comes first, then the number of the building.
In the US the number of the building comes first, then the actual street, which makes it a little bit rougher to sort.

Imagine a table like this:

mysql> SELECT * FROM numsort;

+——+
| a |
+——+
| 5 |
| a |
| 2 |
| d |
| 22 |
| c |
| 33 |
| 3 |
+——+
8 rows in set (0.00 sec)

The desired order in this case would be 2, 3, 5, 22, 33, a, b, c, d.

mysql> SELECT * FROM numsort ORDER BY a;
+——+
| a |
+——+
| 2 |
| 22 |
| 3 |
| 33 |
| 5 |
| a |
| c |
| d |
+——+
8 rows in set (0.00 sec)

Ok, we’re far from what we’re …

[Read more]
Showing entries 1 to 1