Lovely - thanks On 30 September 2014 00:14, David Empson <[email protected]> wrote:
> > On 30/09/2014, at 12:04 pm, Paul Sanderson <[email protected]> > wrote: > > > I two tables of the form > > > > create table1 (person1 text, person2 text) > > create table2 (person text, picture blob) > > > > Is it possible to create a join so I can get a resultant dataset of the > form > > > > person1, person1picture, person2, person2picture > > SELECT person1, p1.picture, person2, p2.picture FROM table1 JOIN table2 AS > p1 ON table1.person1 = p1.person JOIN table2 AS p2 ON table1.person2 = > p2.person; > > The trick is to use table aliases (AS) to allow joining twice to the same > table with different criteria, and then picking columns from the > appropriate instance. > > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786+44 (0)1326 572786+44 (0)1326 572786+44 (0)1326 572786 http://sandersonforensics.com/forum/content.php?190-SQLite-Recovery - Deleted SQLite recovery http://sandersonforensics.com/forum/content.php?168-Reconnoitre - VSC processing made easy _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

