Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 1

Displaying posts with tag: Geeky (reset)

Sorting US Address Data.
Employee +0 Vote Up -0Vote Down

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 |


















  [Read more...]
Showing entries 1 to 1

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.