[?] Make the following conditions more compact?

What if I have the following conditions (when I use Solve-function)?

All characters are different numbers.

I always do this.

Solve[a != b && a != c && a != d && a != e && a != f && a != g &&   a !=
h && b != c && b != d && b != e && b != f && b != g && b != h &&   c
!= d &&.....

However, this method takes a lot of time.
Is there a good way?

Hi Keito,

By “takes a long time” do you mean it takes a long time for Solve to finish, or it takes a long time to manually construct the list of conditions? If the former, you will have to provide more details about the equation you are trying to solve, if the latter, then this is one way to programmatically construct the list of conditions.

ClearAll[a, b, c, d, e, f, g, h];
vars = {a, b, c, d, e, f, g, h};
And @@ (First@# != Last@# & /@ Subsets[vars, {2}])

(*
a != b && a != c && a != d && a != e && a != f && a != g && a != h && 
b != c && b != d && b != e && b != f && b != g && b != h && c != d &&
c != e && c != f && c != g && c != h && d != e && d != f && d != g &&
d != h && e != f && e != g && e != h && f != g && f != h && g != h
*)

The latter. Thank you very much.

An alternative, a bit more compact:

Unequal[a, b, c, d, e, f, g, h]