From 5409e24f3a141482561a5ee025b62a685a060673 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 26 Dec 2017 16:23:26 +0300 Subject: distinct user by email query --- juick-server-jdbc/src/main/java/com/juick/service/UserServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'juick-server-jdbc/src/main') 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 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); -- cgit v1.2.3