Use aggregation instead:
SELECT user_index, name, email FROM table1 GROUP BY user_index, name, email ORDER BY (CASE WHEN email IS NULL THEN 1 ELSE 0 END);
This is functionally the same as your question. However, the SQL engine will not get confused about an expression that uses a
CLICK HERE to find out more related problems solutions.