Skip to content

Instantly share code, notes, and snippets.

@rentalcustard
Created October 5, 2011 16:55
Show Gist options
  • Save rentalcustard/1264996 to your computer and use it in GitHub Desktop.
Save rentalcustard/1264996 to your computer and use it in GitHub Desktop.
WTF mysql
mysql> desc card_commissions;
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| unique_id | varchar(255) | YES | MUL | NULL | |
| year_month | int(11) | YES | | NULL | |
| value | decimal(8,2) | YES | | NULL | |
| created_at | datetime | YES | | NULL | |
| updated_at | datetime | YES | | NULL | |
+------------+--------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)
mysql> select id from card_commissions limit 1;
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.00 sec)
mysql> select year_month from card_commissions limit 1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'year_month from card_commissions limit 1' at line 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment