select distinct (s.C) from TTTT as t, TTTT as s where something and s.A = t.A and s.B = t.B; #### select distinct (s.C) from TTTT.t, TTTT.s where something and s.A = t.A and s.B = t.B;