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 2005 Forums
 Transact-SQL (2005)
 Updation of a Table with Nearest max Least Value

Author  Topic 

Sudha1234567
Starting Member

5 Posts

Posted - 2009-09-01 : 04:56:18
i has a table named temp with fields

The Temp Table is as Below
ID NAME
1 System1
2 System2
3 System3
4 System4
5 System5
6 NULL


The ID 6 Name has to be Updated wih the Next Maximum Least Value which has Name NOT NULL

I has to update the name with System5 (by taking next maximum Least value of ID to the ID which name NULL)
i.e (The ID 4 has name NULL and it has to take the next maximum Leastt value which has name Not NULL i.e ID 5
So it has to update the name as System5 for ID 6)

can any one help me how can we approach this

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-01 : 05:03:18
Why are you opening new topics?
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=132023

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Sudha1234567
Starting Member

5 Posts

Posted - 2009-09-01 : 05:17:14
The Topic which you shared is taking only the Nex Greates value.

But i has to take the max Least value to update the name

Check the topic which i created

it is entirely different from the topic which you shared
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-01 : 06:02:24
quote:
Originally posted by Sudha1234567

The Topic which you shared is taking only the Nex Greates value.

But i has to take the max Least value to update the name

Check the topic which i created

it is entirely different from the topic which you shared


The logic is easily modified to suit your requirement. Have you tried anything so far?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -