In summary, we used bioinformatics methods and multiple algorithms to integrate multiple RNA-seq datasets and scRNA-seq dataset and found that SLC24A2 may prevent the occurrence of T2D complicated by cancer via maintaining the ribosome function of islet beta cells and play different prognostic roles in cancers. This evidence concerns the gene SLC24A2 and cancer.