On 28 Dec 2010, at 10:39am, Giulio Mastrosanti wrote: > Now my problem is, that for a number of reasons now I can have an A record > linked to more than one records B with the same ID, so I could have a table > A_B filled this way: > > A_id | B_id > 1 1 > 1 2 > 1 3 > 2 1 > 2 2 > 2 2
Do a first SELECT which gathers the A_ids you want, and use the DISTINCT keyword to make sure you return only one of each combination. Then do your second search based on the A_ids returned by the first search. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users