This paper proposes a novel distance measure to address the clustering problem of categorical data. Existing categorical data lack a clear metric space, such as Euclidean distance, which can lead to information loss during the clustering process. To address this, this paper presents a novel ordinal distance measure that learns the optimal ordering relationship between categorical attribute values and quantifies distances in a linear space, similar to numerical attributes. Considering the ambiguity and fuzziness of subjective categorical values, we develop a novel joint learning paradigm that learns the ordinal distance measure simultaneously with the clustering process. This method offers low time complexity and guaranteed convergence, achieving excellent clustering accuracy on categorical and mixed datasets. The learned ordinal distance measure facilitates the understanding and management of non-intuitive categorical data. The effectiveness of the proposed method was verified through extensive experiments, and the source code has been made available.