[Wolves] MySQL - equi-join DISTINCT

Philip Harper ph004h7245 at blueyonder.co.uk
Wed Jul 18 12:36:10 BST 2007

$last = mysql_query("SELECT DISTINCT * FROM user, userlog WHERE 
userlog.username = user.username LIMIT 0, 20") or die(mysql_error());

This SQL works, but still returns 4 records, the total number of records 
in the table userlog, so the DISTINCT clause isn't filtering out the 
duplicates in table userlog, anyone any ideas where DISTINCT goes in the 

More information about the Wolves mailing list