Re: [sqlite] UPDATE a ROW based on an UPDATE of a different ROW

2008-12-23 Thread jose isaias cabrera
"Igor Tandetnik" wrote... >> As you can see, this UPDATE, >> >> UPDATE foo SET bdate = (SELECT f2.edate FROM foo f1 JOIN foo >> f2 ON f1.PID = f2.PID AND f1.lang = f2.lang WHERE f1.job = 'val' AND >> f2.job = 'trans' AND f1.id = foo.id AND f1.bdate < f2.edate) >> WHERE foo.job = 'val'; >> >>

Re: [sqlite] UPDATE a ROW based on an UPDATE of a different ROW

2008-12-22 Thread jose isaias cabrera
"Igor Tandetnik" wrote... >> As you can see, this UPDATE, >> >> UPDATE foo SET bdate = (SELECT f2.edate FROM foo f1 JOIN foo >> f2 ON f1.PID = f2.PID AND f1.lang = f2.lang WHERE f1.job = 'val' AND >> f2.job = 'trans' AND f1.id = foo.id AND f1.bdate < f2.edate) >> WHERE foo.job = 'val'; >> >>

Re: [sqlite] UPDATE a ROW based on an UPDATE of a different ROW

2008-12-22 Thread Igor Tandetnik
"jose isaias cabrera" wrote in message news:5c0942b2619c4403b47ddf72586c8...@stso.mc.xerox.com > As you can see, this UPDATE, > > UPDATE foo SET bdate = (SELECT f2.edate FROM foo f1 JOIN foo > f2 ON f1.PID = f2.PID AND f1.lang = f2.lang WHERE f1.job = 'val' AND > f2.job = 'trans' AND f1.id = foo.i

[sqlite] UPDATE a ROW based on an UPDATE of a different ROW

2008-12-22 Thread jose isaias cabrera
Greetings! imagine this situation... CREATE TABLE foo (id, PID, bdate, edate, lang,job); INSERT INTO foo VALUES (1, 232,'2008-01-01','2008-01-10','es','trans'); INSERT INTO foo VALUES (2, 232,'2008-01-01','2008-01-10','fr','trans'); INSERT INTO foo VALUES (3, 232,'2008-01-01','2008-01-10','it','