Re: update statement
From: hngo01 (hngo01_at_hotmail.com)
Date: 03/19/04
- Next message: toylet: "Re: wait delay"
- Previous message: anonymous_at_discussions.microsoft.com: "Re: update statement"
- In reply to: Vishal Parkar: "Re: update statement"
- Next in thread: Hugo Kornelis: "Re: update statement"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 19 Mar 2004 07:51:15 -0800
Thank you but this would not work because if I have this
data. I like to get the one that immediately above the
TOOL which is 'DDD2323' NOT the one below the TOOL which
is 'QWQWQWQ' . Thanks a lot
PrimaryKey Name TestCode Result UnitNumber
1 aaaa %UN 12345NN
2 aaaa TOOL 1
3 bbbb %UN 11AAAAA
4 bbbb %UN DDD2323
5 bbbb TOOL 1
6 bbbb %UN QWQWQWQ
>-----Original Message-----
>Try:
>
>--replace #t with the tablename you have
>
>begin transaction
>update #t
>set unitnumber
>=(select result from #t a
> where a.name = #t.name and primarykey =
> (select max(primarykey) from #t where #t.name = a.name
and testcode = '%UN') )
>where testcode ='TOOL'
>
>--check the data and commit/rollback accordingly.
>
>--
>Vishal Parkar
>vgparkar@yahoo.co.in
>
>
>.
>
- Next message: toylet: "Re: wait delay"
- Previous message: anonymous_at_discussions.microsoft.com: "Re: update statement"
- In reply to: Vishal Parkar: "Re: update statement"
- Next in thread: Hugo Kornelis: "Re: update statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|