diff options
author | Vitaly Takmazov | 2017-12-26 16:23:26 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-12-26 16:23:26 +0300 |
commit | 5409e24f3a141482561a5ee025b62a685a060673 (patch) | |
tree | ddc689caefc4e2e8cadf55108f2d378abf026fbd | |
parent | 6e1c52c8014083f3fcc0133b64e46f013f3afab8 (diff) |
distinct user by email query
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java | 2 |
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); |