Can I change more than one record at a time?

6

This is the code:

UPDATE PESSOAS
SET COR = ('Pardo')
WHERE ID = 1;

But I have 2 more records to do the same procedure, would you do it all at once by adding ID ?

    
asked by anonymous 27.10.2017 / 19:55

1 answer

13

Just say the WHERE clause you want to do in several, you could use OR to select multiple ID s, but I think in this case it is more appropriate to use IN() .

UPDATE PESSOAS
SET COR = ('Pardo')
WHERE ID IN (1, 2, 3);
    
27.10.2017 / 20:00