Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update top record only

Status
Not open for further replies.

James1981

Programmer
Nov 2, 2002
76
US
Hi,

I want to update 1 record in a table based on a where clause that will return more than one record.

I suppose it is similar to a SELECT TOP 1 field FROM table statement.

Does anyone know if it is possible to use the TOP keyword or is there a more complicated way of doing it?

Thanks

James
 
update yourtable
set foo = 'bar'
where id = ( select id from ... )


rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top