Created
April 18, 2017 11:08
-
-
Save dimaqq/2f1c725fd7d544f083dd03a47b64abc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> describe weather; | |
+---------+------------+------+-----+---------+-------------------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+---------+------------+------+-----+---------+-------------------+ | |
| date | char(10) | NO | PRI | NULL | | | |
| geohash | char(4) | NO | PRI | NULL | | | |
| weather | json | YES | | NULL | | | |
| todo | tinyint(4) | YES | MUL | NULL | VIRTUAL GENERATED | | |
+---------+------------+------+-----+---------+-------------------+ | |
4 rows in set (0.01 sec) | |
mysql> select * from weather; | |
+------------+---------+---------+------+ | |
| date | geohash | weather | todo | | |
+------------+---------+---------+------+ | |
| 2010-10-10 | w21z | NULL | 1 | | |
+------------+---------+---------+------+ | |
1 row in set (0.00 sec) | |
mysql> select ST_LatFromGeohash(geohash) from weather; | |
ERROR 3064 (HY000): Incorrect type for argument geohash in function ST_LATFROMGEOHASH. | |
mysql> select ST_LatFromGeohash(CAST(geohash as CHAR(4))) from weather; | |
+---------------------------------------------+ | |
| ST_LatFromGeohash(CAST(geohash as CHAR(4))) | | |
+---------------------------------------------+ | |
| 1.3 | | |
+---------------------------------------------+ | |
1 row in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment