Update with Select Top

  • Thread starter Thread starter Tomer
  • Start date Start date
T

Tomer

I need to update the top first row of a table with a sql query,
I'v connected my ppc to a sql server 2000, and from the ppc i need to run
the query.
I know the query should look something like this:

update set code='xxx' (select top 1 * from tablename)

Any ideas?


Tomer.
 
Assume that you have a PK Column called Primary (Primary is a key word but
replace it with whatever your PK Column name is)

You could use UPDATE myTable SET code = 'xxx' where Primary = (SELECT TOP
1(Primary) From myTable)
 
Back
Top