All pastes #784635 Raw Edit

Someone

public sql v1 · immutable
#784635 ·published 2007-11-19 19:55 UTC
rendered paste body
Goal: Get all the nodes of type abstract which have no term of vocabulary (vid) 10 assigned to them.What I tried:SELECT node.nid, term_node.tid FROM node LEFT JOIN term_node USING (nid) LEFT JOIN term_data ON (term_data.tid=term_node.tid AND term_data.vid=10) WHERE term_node.tid IS NULL   AND type = 'abstract' LIMIT 5;Results:I get nodes which have ZERO term assigned to them but the nodes that have some other term assigned to them does NOT get returned by this query.