I have the following tables CREATE TABLE data( id INTEGER PRIMARY KEY NOT NULL, name TEXT DEFAULT '', title TEXT DEFAULT '', .... )
CREATE TABLE pivot( id INTEGER PRIMARY KEY NOT NULL, link1 INTEGER DEFAULT 0, link2 INTEGER DEFAULT 0, rank INTEGER DEFAULT 0, mdate MYDATE DEFAULT 0, status TEXT DEFAULT '', ) link1 and link2 are id's from tbl1 With this sql I get half way to what I want SELECT name,title,pivot.id AS id,mdate,status FROM data,pivot WHERE data.id=pivot.link1 ORDER BY name,pivot.rank How do I get the name,title from data onto the same row WHERE data.id=pivot.link1 and pivot.link2=a different data.id this obviously does not work My knowledge of SQL is limited Cheers Walter _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users