我想在我的表中删除行,其中我有最小的时间戳值。
DELETE FROM `table_name` WHERE `time_Stamp` =MIN(`table_name.time_Stamp`)
答案 0 :(得分:0)
DELETE FROM table_name WHERE time_Stamp =(select MIN(a.time_Stamp) from table_name a)
答案 1 :(得分:0)
首先你做一个像
这样的选择语句select * FROM table_name WHERE time_Stamp =(select MIN(table_name.time_Stamp) from table_name)
并检查您是否获得了所有正确的记录,然后您可以使用
DELETE FROM table_name WHERE time_Stamp =(select MIN(table_name.time_Stamp) from table_name)
答案 2 :(得分:0)
E.g:
DELETE x
FROM my_table x
JOIN
( SELECT MIN(a) min_a FROM my_table ) y
ON y.min_a = x.a;