0
它應該是簡單,但它不工作如何在MySQL中使用H搜索名稱?
SELECT * FROM profile WHERE name LIKE = 'H%';
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 '= 'H%'' at line 1
列從表
SHOW COLUMNS FROM profile;
+-------+-------------------------------------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------------------------------------------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(20) | NO | | NULL | |
| birth | date | YES | | NULL | |
| color | enum('blue','red','green','brown','black','white') | YES | | NULL | |
| foods | set('lutefisk','burrito','curry','eggroll','fadge','pizza') | YES | | NULL | |
| cats | int(11) | YES | | NULL | |
我應該嘗試一下呢?