Re: [sqlite] nested tree table porting from mysql -> sqlite

2008-03-20 Thread Dennis Cote
Igor Tandetnik wrote: > > You don't need SELECT keyword here. You could also get closer to the > original statement with > > UPDATE tableName SET rgt = rgt + (CASE WHEN (rgt < %1) THEN %2 ELSE -%3 > END); > This also has the advantage that it is standard SQL and therefore portable to many ot

Re: [sqlite] nested tree table porting from mysql -> sqlite

2008-03-20 Thread Igor Tandetnik
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have trouble to move up node on sqlite > on mysql i write: > UPDATE SET rgt = rgt + IF(rgt<%1,%2,-%3) > on sqlite i must rewrite query to > UPDATE SET rgt = (SELECT CASE WHEN (rgt < %1) THEN rgt + %2 ELSE rgt > + -%3 END) You don't ne

[sqlite] nested tree table porting from mysql -> sqlite

2008-03-20 Thread ciz
I have trouble to move up node on sqlite on mysql i write: UPDATE SET rgt = rgt + IF(rgt<%1,%2,-%3) on sqlite i must rewrite query to UPDATE SET rgt = (SELECT CASE WHEN (rgt < %1) THEN rgt + %2 ELSE rgt + -%3 END) is here a way to create a trigger or similar on sqlite to support IF(expression,int o