PDA

View Full Version : SQL Logic Prob



Dravos
February 21st, 2003, 10:37 AM
Hello,

I have a field called TopicNum
in there are values


[1]=Top1
[2]=Top2
[3]=Top3
[4]=Top4
[5]=Top5
[6]=Top6

Now i want to move 5 before 1
so...


[0]=Top5
[1]=Top1
[2]=Top2
[3]=Top3
[4]=Top4
[6]=Top6


Now i need to move 1,2,3,4 to 2,3,4,5
but 1 cant go to 2 cos 2 is still there

i could do sepearte queries and do 4 to 5 then 3 to4 etc but this is lengthy with more records
is there any way i can do this in one query.

end result should be



[1]=Top5
[2]=Top1
[3]=Top2
[4]=Top3
[5]=Top4
[6]=Top6


Thanx