jeudi 13 août 2015

Update row with minimum value sql

I have this table:

-----------------------
summonerId | timestamp
-----------------------
253222     | 14395235091096
929112     | 14395235091056
(...)

I want to update the row with the lower timestamp but I can't, when I do this

UPDATE summoners_shell 
SET 
summonerId = ".$s.",
timestamp = ".$time." 
WHERE timestamp = (SELECT MIN(timestamp))

It updates all rows! Why? How do I do what I want?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire