Here is an example of what I want. I have an id and I want to select *
the id and all it's parent. Is it possible?
cn.Execute("create table if not exists Link( id INTEGER PRIMARY KEY AUTOINCREMENT , `parent` INT , `val` INT NOT NULL , FOREIGN KEY (parent) REFERENCES Link(id));", new { });
cn.Execute("insert into Link(val) values(3)");
cn.Execute("insert into Link(parent, val) values(last_insert_rowid(), 5)");
cn.Execute("insert into Link(parent, val) values(last_insert_rowid(), 9)");
var id = cn.Query<long>("select last_insert_rowid()", new{});
cn.Execute("insert into Link(parent, val) values(last_insert_rowid(), 8)");
cn.Execute("insert into Link(val) values(4)");