mysql同表條件更新

mobile表結構如上: 實現根據color排序,取出top20,然後更新level爲M 具體sql如下: update mobile set level=( SELECT "M" from (select id from mobile order by color limit 20) as m where mobile.id=id )
相關文章
相關標籤/搜索