sql - update with subselect/how to select time greater than 24 hours -


Please see the image below. I'm new to SQL syntax and I have the following update statement with a sub-style. I'm not sure this is the right way to do this, but I have it.

Check out what I have to do LastRestartTime and if this is more than 24 hours RestartInterval , update the restart time for the current time.

I have an exe that will check the table for the LastRestartTime and if is active = 1 and RestartInterval & gt; = 24 , it will kill and restart (or just stop the process if it was stopped) Process

Then I will use LastRestarttime in that current time Want a program to update

I'm not sure how to do this.

  Update any _table.dbo.this database LastRestartTime = GetDate () in ProcessName (choose the name of the process from any_table.dbo. This database where LastRestartTime> 24);  

Enter image details here

It does not appear that you need a subquery, try:

  any _table Dbo.thisDatabase SET LastStarttime = CURRENT_TIMESTAMP Where Last Lastime & lt; = DATEADD (hour, -24, CURRENT_TIMESTAMP);  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -