Q: SQL Column compare in the same table (self-join)

hotsite

New Member
I need a hint in order to solve this SQL (self-join) problem:a table, with columns \[code\]value\[/code\] and \[code\]category\[/code\] \[code\] id || value || category || foo------------------------------------ 1 || 1 || a || 1 2 || 2 || a || 4 3 || 3 || a || 2 4 || 0 || b || 2 5 || 1 || b || 1 6 || 2 || b || 4 7 || 3 || b || 2 8 || 4 || b || 2 9 || 5 || b || 110 || 5 || b || 411 || 6 || b || 212 || 99 || z || 2\[/code\]I would like to compare all values from category \[code\]b\[/code\] and all values from category \[code\]a\[/code\] and get all values that are in \[code\]b\[/code\] and not in \[code\]a\[/code\] or their \[code\]id\[/code\], so:(0,1,2,3,4,5,5,6) "compare" (1,2,3) => (0,4,5,5,6)best regards.
 
Back
Top