Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Updating specific records

Author  Topic 

jay_pink_elephant
Starting Member

3 Posts

Posted - 2008-10-11 : 10:14:04
hi, i am tryin to update 6 specific records out of 400 odd. Problem is my statement is updating all 400 records.

UPDATE AM_X_422_2
SET
security_level =
(
SELECT
MAX(security_level)
FROM
(
SELECT
code_name,
LENGTH(code_name),
security_level,
mission_date
FROM
AM_X_422_2
ORDER BY
mission_date desc
)
WHERE
rownum < 11
)
WHERE
LENGTH(code_name) > 7
;


I want to update the security level to the highest security level for missions which are within the 10 most recent missions and where length of the first word of the mission code_name exceeds 7 characters.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-11 : 10:55:30
Using SQL Server 2005, SQL Server 2000 or SQL Server 2008?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

jay_pink_elephant
Starting Member

3 Posts

Posted - 2008-10-11 : 10:59:06
sorry im actually using oracle 10g. Wrong forum i know, but hopefully sum1 can still help.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-11 : 11:59:46
have you posted question at oracle forum in www.dbforums.com ?
Go to Top of Page

jay_pink_elephant
Starting Member

3 Posts

Posted - 2008-10-12 : 06:13:40
i have now
Go to Top of Page
   

- Advertisement -