Query Rows That Have a Following Row That Meets Criteria
I've used MySQL, but it should apply to virtually all database servers.

CREATE TABLE `test1` 
(
  `user` varchar(10) DEFAULT NULL,
  `logintype` int(11) DEFAULT NULL
);



mysql&gt; SELECT * FROM test1;
+------+-----------+
| user | logintype |
+------+-----------+
| Bob  |         1 |
| Ryan |         1 |
| Tom  |         1 |
| Tom  |         3 |  &lt;&lt;== ALSO WORKS IF YOU HAVE ANOTHER 
+------+-----------+       RECORD TOM, 5
4 rows in set (0.00 sec)

mysql&gt; 

SELECT t1.user, t1.logintype  
FROM test1 t1 
INNER JOIN test1 t2  
ON t1.user = t2.user 
AND t1.logintype != t2.logintype 
GROUP BY t1.user, t1.logintype  
ORDER BY logintype;    

+------+-----------+
| user | logintype |
+------+-----------+
| Tom  |         1 |
| Tom  |         3 |
+------+-----------+