Re: [sqlite] Help with complex UPDATE question

2010-07-23 Thread peterwinson1
l data to the rows so you can refer to them > unambiguously. > > table1 (KEY, COL1, ord) > > 0, 1,1 > 0, 2,2 > 1, 3,1 > 1, 4,2 > 2, 5,1 > 2, 6,2 > 3, 7,1 > 3, 8,2 > > > On 7/23/2010 12:16 PM, peterwinson1 wrote: >> Jim you maybe correct t

Re: [sqlite] Help with complex UPDATE question

2010-07-23 Thread peterwinson1
; > On 7/23/2010 8:03 AM, peterwinson1 wrote: >> Thanks Eric and Alan for your help. I tried to apply your code to my >> problem >> and it works to a limited extent because the problem is more complicated >> than the example I gave in the post. I tries to simplify my

Re: [sqlite] Help with complex UPDATE question

2010-07-23 Thread peterwinson1
et 0, 0 //(1 - 1) 0, 1 //(2 - 1) 1, 2 //(3 - 1) 1, 3 //(4 - 1) 2, 5 2, 6 3, 7 3, 8 Is this possible in SQL? peterwinson1 wrote: > > Hello, > > I have a some what complex question about UPDATE. I have the following > table > > table1 (KEY, COL1) > > 0, 1 > 1

[sqlite] Help with complex UPDATE question

2010-07-22 Thread peterwinson1
Hello, I have a some what complex question about UPDATE. I have the following table table1 (KEY, COL1) 0, 1 1, 2 2, 3 3, 4 What I would like to do is to UPDATE COL1 by subtracting the COL1 value where KEY = 0 from the COL1 value of the current row so that the result would be. 0, 0 1, 1 2, 2