aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-12-26 16:23:26 +0300
committerGravatar Vitaly Takmazov2017-12-26 16:23:26 +0300
commit5409e24f3a141482561a5ee025b62a685a060673 (patch)
treeddc689caefc4e2e8cadf55108f2d378abf026fbd /juick-server-jdbc
parent6e1c52c8014083f3fcc0133b64e46f013f3afab8 (diff)
distinct user by email query
Diffstat (limited to 'juick-server-jdbc')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java
index 6196af86..9aa82559 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java
@@ -163,7 +163,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService {
public User getUserByEmail(String email) {
if (StringUtils.isNotBlank(email)) {
List<User> list = getJdbcTemplate().query(
- "SELECT id, nick, banned, lang FROM users WHERE id = (SELECT user_id FROM emails WHERE email = ?)",
+ "SELECT id, nick, banned, lang FROM users WHERE id = (SELECT DISTINCT user_id FROM emails WHERE email = ?)",
new UserMapper(),
email);