Quote:
Originally Posted by iburyak
Try this:
- update trial_clear set num = @count2 /* @count2 is a integer passed*/
-
where def =
-
case when (select top 1 def from trial_clear where num is NULL) is NULL Then null
-
else @def end
Good Luck.
thanks for the code but still it doesn't work, i should have made my message clear... you see i've got this table..
--table---
trial_clear(num,def,def2,def3)
--these are the existing values--
1st row (NULL,q,NULL,NULL)
2nd row (NULL,w,w,NULL)
3rd row (NULL,e,e,r)
4th row (t,NULL,y)
5th row (q,w,NULL)
you see what i was supposed to do is update this table, assigning the num value with int.. starting form 1 to so on...the table i presented is just a prototype of the real table
while making my procedure i noticed that it will only work if i would say 'def is NULL' not def = NULL and that was why i was wondering if there was and if else statement inside the where clause