Re: [sqlite] following a trail of references

2014-10-13 Thread Paul Sanderson
Thanks both - modified the code for my example but it failed :( I'll keep at it and see if I can get my head around it. Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786 http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit

Re: [sqlite] following a trail of references

2014-10-12 Thread Igor Tandetnik
On 10/12/2014 4:03 PM, Paul Sanderson wrote: Is this possible just using SQL select type statements? With sufficiently recent SQLite version, you can do something like this (untested): with recursive path as ( select id, previousid, location from mytable where id=6 union all select id,

Re: [sqlite] following a trail of references

2014-10-12 Thread Simon Slavin
On 12 Oct 2014, at 9:03pm, Paul Sanderson wrote: > Is this possible just using SQL select type statements? I don't know how to do it but I bet you can do it with a recursive WITH: Simon.

[sqlite] following a trail of references

2014-10-12 Thread Paul Sanderson
I think this might be beyond the ability of SQL - but there are cleverer people on here than me, so I might be wrong :) Lets say we have a table Create table (id integer primary key, previousid integer, location text) previousid contains a pointer to ID or 0 for no previous id, so for instance