开发者

mysql, how to delete selected data from database?

i have a table like this: table 1

    id  time
122639  1315510027
122639  131551002开发者_开发问答6
122639  1315510027
122639  1315510030
122640  1315510366

how can i make a query that deletes everything but 122640 1315510366 ? even if i have to use php

any ideas?

Thsnks


DELETE FROM table1 WHERE id != 122640;

Note: if you have other entries with that ID, you'll need to do id != 122640 AND time != 1315510366;

http://dev.mysql.com/doc/refman/5.0/en/delete.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜