Dennis, Very cool. Thanks for showing the example. You always seem to offer well-considered solutions. It might just be a practical tool for the job here.
I could see the materialized path solution working both for finding the change history, and for producing a browser-based UI for identifying a release's predecessor. -Clark ----- Original Message ---- From: Dennis Cote <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Tuesday, March 20, 2007 11:27:39 AM Subject: Re: [sqlite] Finding linked peers Clark Christensen wrote: > So, finally, the question: What might the SQL look like to retrieve a list > of predecessors for 'PC1_v1.3'? Sure, I could prepare a stmt in the app > (Perl), and walk the chain in some fashion. Is this result even possible > using plain SQL? > > Clark, SQLite does not support the recursive SQL queries that could be used to do this kind of processing. So there is no way to follow a chain in SQL. You can convert the problem into pattern matching by having each record store the path along the chain in that record. This is really a variation of the SQL tree problem. I have previously posted a sample implementation of this materialized (or stored) path method at http://www.mail-archive.com/sqlite-users@sqlite.org/msg13225.html HTH Dennis Cote ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------