Here's the following SQL in SQL Fiddle.第一次發生other_field = value時更新字段?
+-----+-----+-------------+
| id | rel | content |
+-----+-----+-------------+
| 1 | 1 | example 1 |
| 2 | 2 | test 2 oops |
| 3 | 1 | example 2 |
| 4 | 2 | test 2 |
+-----+-----+-------------+
如何申請SET content = "test 1"
到僅在第一記錄WHERE rel = 2 ORDER BY id ASC
不知道該記錄的ID?沒有任何子查詢可以這樣做嗎?
有你嘗試與限制1更新? –
http://stackoverflow.com/questions/11424861/mysql-update-first-instance-of-a-record –
@DipeshParmar'JOIN'是一個子查詢,不是嗎? –