[sqlite] SQL tree and deepness level

2006-11-14 Thread Robert Zajda
Hello I have a table CREATE TABLE acategories { id integer not null primary key category string parent_category integer references acategories.id ) query: SELECT a.id AS 'id', a.category AS 'Category', b.category AS 'Parent category' FROM acategories AS a LEFT JOIN acategories

Re: [sqlite] Re: Re: Re: Changing order

2006-11-12 Thread Robert Zajda
On 11/13/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote: Robert Zajda <[EMAIL PROTECTED]> wrote: > On 11/12/06, Igor Tandetnik <[EMAIL PROTECTED]> > wrote: >> Robert Zajda >> <[EMAIL PROTECTED]> >> wrote: >>>> Perhaps something l

Re: [sqlite] Re: Re: Changing order

2006-11-12 Thread Robert Zajda
On 11/12/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote: Robert Zajda <[EMAIL PROTECTED]> wrote: >> Perhaps something like this: >> >> update articles set order=-1 where order=:oldorder >> update articles set order=:oldorder where order=:neworder >> updat

Re: [sqlite] Re: Changing order

2006-11-12 Thread Robert Zajda
On 11/12/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote: Bambero <[EMAIL PROTECTED]> wrote: > I have little problem with changing order of rows. I have a simple > table articles: > > CREATE TABLE articles ( > id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, > title VARCHAR, > content VARCHAR, >

Re: [sqlite] Changing order

2006-11-12 Thread Robert Zajda
On 11/12/06, Gerry Snyder <[EMAIL PROTECTED]> wrote: Bambero wrote: > Hello > > I have little problem with changing order of rows. I have a simple > table articles: > > CREATE TABLE articles ( > id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, > title VARCHAR, > content VARCHAR, > order INTEGER