Rich Shepard wrote: > I have two tables that should have the same number of rows, but one is 2 > rows short and I'm trying to identify which rows exists in the first table > (Fuzzyset) that's missing from the second table (Rules). > > I thought that a right outer join might work with "NOT EXISTS" in the <snip> > > I'm sure that I've seen (and probably used) this type of query before so > I've no idea why the proper syntax is eluding me. > > A clue stick will be very helpful.
Clue stick coming up. There's a much simpler solution. You should be using relational difference instead, the MINUS keyword, whose syntax is the same as UNION but for the keyword. Try this: (select f.parent as c1, f.subcomp as c2, f.comp as c3 from Fuzzyset as f) minus (select r.var_name as c1, r.subcomp_name as c2, r.comp_name as c3 from Rules as r) The result should have 3 columns and 2 rows. Rename c1,2,3 to taste, or adjust any other details as necessary. If you wanted more info returned than that, then use the above in a subquery which is joined with Fuzzyset. -- Darren Duncan _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users