SELECT IF(MOD(angle, PI()) = 0, NULL, COT(angle)) AS SafeCotangent FROM angles_table;