Home » RDBMS Server » Server Administration » SQL
SQL [message #370831] Sat, 12 February 2000 19:03 Go to next message
Messages: 284
Registered: July 1998
Senior Member
Can you see what is wrong with following code.

update history H
set H.install = P.updated
where H.install = 0 AND userid in (
select userid
from users P
where P.active = 1 or P.active = 2);

I like to update install column in history table for every users in the users table who have active status of 1 or 2.

Re: SQL [message #370836 is a reply to message #370831] Mon, 14 February 2000 16:15 Go to previous message
Messages: 189
Registered: December 1998
Senior Member
Try following query....
update history h
set h.install=(select p.updated from users p where h.userid =p.userid
where h.install=0 and
h.userid in (
select p.userid from users p where
(p.active=1 or p.active=2))

Hope this helps..
Previous Topic: Sql statement
Next Topic: Translate a numérique to date
Goto Forum:

Current Time: Fri Oct 30 03:29:10 CDT 2020