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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SQL Query Help

Author  Topic 

saidev
Posting Yak Master

101 Posts

Posted - 2006-06-20 : 19:36:24
Guys,

i am trying to update the table with the max(id), can you guys help me with this query.

update tblboard SET boardtype = 'ATTEND' ORDER BY max(id)


It is giving me the error at order. how to update this table boardtype = attend based on max(id)
appreciate your help

Thanks,

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-06-20 : 19:40:47
UPDATE tblboard
SET boardtype = 'ATTEND'
WHERE id = (SELECT MAX(id) FROM tblboard)

Tara Kizer
aka tduggan
Go to Top of Page

CSK
Constraint Violating Yak Guru

489 Posts

Posted - 2006-06-21 : 01:56:20
We cant Use The Order by Clause in Update statement

UPDATE tblboard
SET boardtype = 'ATTEND'
WHERE id = (SELECT MAX(id) FROM tblboard)

-- KK
Go to Top of Page

saidev
Posting Yak Master

101 Posts

Posted - 2006-06-21 : 11:11:12
Thank You guys, appreciate your help
Go to Top of Page
   

- Advertisement -