I\'ve got an MS access database and I would need to create an SQL query that allows me to select all the not distinct entries in one column while still keeping all the value
Another way of returning the results you want would be this:
select *
from
my_table
where
B in
(select B from my_table group by B having count(*) > 1)
Select B, C
From Table
Where B In
(Select B From Table
Group By B
Having Count(*) > 1)
select
*
from
my_table t1,
my_table t2
where
t1.B = t2.B
and
t1.C != t2.C
-- apparently you need to use <> instead of != in Access
-- Thanks, Dave!
Something like that?
join the unique values of B you determined with group by b and count > 1 back to the original table to retrieve the C values from the table.