Hello all,

A small SQL problem, no doubt, for experts here.

Let's say we've got 4 tables:

CREATE TABLE TABLEA ( ID INTEGER PRIMARY KEY, IDB INTEGER, IDC INTEGER, IDD 
INTEGER );
CREATE TABLE TABLEB ( ID INTEGER PRIMARY KEY, DATA );
CREATE TABLE TABLEC ( ID INTEGER PRIMARY KEY, DATA );
CREATE TABLE TABLED ( ID INTEGER PRIMARY KEY, DATA );

What I'm trying to achieve is something like the following:

SELECT * FROM TABLEB WHERE ID IN ( SELECT IDB AS ID FROM TABLEA LEFT JOIN 
TABLEB ON IDB=1 )

But I also need to add additional constraints from TABLEC and TABLED to narrow 
down the results. Basically, I only want results from TABLEA with a given set 
of IDB, IDC and IDD (there could be multiple of each of course).

Can you please help me out - any hints are greatly appreciated!

Thank you in advance,

   Dennis

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to