Home » RDBMS Server » Server Administration » SQL
SQL [message #370831] Sat, 12 February 2000 19:03 Go to next message
Mark
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.

Thanks
Re: SQL [message #370836 is a reply to message #370831] Mon, 14 February 2000 16:15 Go to previous message
Suresh
Messages: 189
Registered: December 1998
Senior Member
Hi,
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..
Suresh
Previous Topic: Sql statement
Next Topic: Translate a numérique to date
Goto Forum:
  


Current Time: Tue Apr 16 08:59:35 CDT 2024