select c1, count (*) The from ( The select c1 from t Union all Select the c2 from t . Union all Select the c7 from t) total Group by c1 The order by the count (*) desc;
Question 2:
with recursive n (c) as ( Select 1 Union all Select c + 1 from n where c & lt; 36 ) Select * from n Where c not in ( The select c1 from t Union all Select the c2 from t . Union all Select the c7 from t) ;