var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Find the list of X for which there is only one Y?
I am trying to find an SQL query that will return a list of items in column X that only appear once, or more precisly only have 1 corresponding Y (X is key). For example:
X | Y
In this case, I would expect to only get back "0" because it only has one corresponding Y value (a), whereas "1" has two (a & b) and "2" has 3 (c & d & e) ... etc....
Any help would be greatly appreciated...
Assuming your table is called R and your columns are x and y:
select x from
(select x, count(distinct y) nums from R group by x) y_count
where nums = 1;
topcat2: thanks for the information. Quick question, do you know how to convert this to Relational Algebra?