我需要从我的数据库中提取一些数据,但问题是Im从数据库中获取重复值,这是我不想要的。从MYSQL数据库中选择DISTINCT
用户名被存储在数据库中多次。
我试过使用DISTINCT,但没有奏效。
谁能告诉我如何从数据库中只提取一次用户名?
代码:
PreparedStatement preparedStatement = connect
.prepareStatement("SELECT DISTINCT username, score, name from score order by score desc limit 10");
它只是'用户名'这是重复的也是'分数'和'名称'? –
只有用户名 – user3702643