0

I need to update multiple row by one query. I have created query as well and its working fine for me but now the issue is. I need to update modify_date with 5 second delay.

In my current user table I have 3 columns:

id | PID | name           | modify_date
1    1      employee      | 
2    1      employee      | 
3    1      employee      |
4    1      employee      | 

My query:

Update name = 'Pritesh' 
where PID = 1

Above query is working for me. But I need to update modify_date column as well with 5 sec delay like for 1st row it will update 1 sec and for 2nd row it will update 5 sec like that.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Pritesh Mahajan
  • 4,974
  • 8
  • 39
  • 64
  • 1
    How update without table name is working? Which DBMS you are using? – Nishant Gupta Apr 27 '22 at 11:47
  • You could probably use RANK for that. Depends on the DBMS - mssql, oracle, mysql for sure [mysql-update-statement-to-store-ranking-positions](https://stackoverflow.com/questions/3196971/mysql-update-statement-to-store-ranking-positions) – erelguitars Apr 27 '22 at 14:22

0 Answers0