Neville Franks <[EMAIL PROTECTED]> wrote: > I have a table that holds 1 to many items. To keep it simple say it > has 2 columns: tagid and noteid. A given tagid can have many noteid's. > ex. > tagid noteid > ------ ------ > a 1 > a 4 > a 7 > b 7 > b 3 > c 1 > > I want to perform a query: give me all noteid's that have tagid a and > tagid b.
select t1.noteid from tableName t1 join tableName t2 on (t1.noteid = t2.noteid) where t1.tagid='a' and t2.tagid='b'; Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users