tqla Posted July 18, 2007 Share Posted July 18, 2007 Hi. I get duplicates in my results becuase the relationship of the two databases in 1 to many. How can I add DISTINCT to this select statement? "SELECT * FROM Clients cl INNER JOIN CompaniesNew co ON co.ClientNum = cl.ID WHERE co.Year = '2007' AND co.Publish = 'Y'"); Thanks. Link to comment https://forums.phpfreaks.com/topic/60617-solved-how-to-add-distinct-to-this/ Share on other sites More sharing options...
jvrothjr Posted July 18, 2007 Share Posted July 18, 2007 You have to state which field is distinct "select distinct cl.Name from clients cl inner join CompaniesNew co on co.ClientNum = cl.ID where co.Year = '2007' and co.Publish = 'y'" Link to comment https://forums.phpfreaks.com/topic/60617-solved-how-to-add-distinct-to-this/#findComment-301552 Share on other sites More sharing options...
tqla Posted July 18, 2007 Author Share Posted July 18, 2007 Perfect. Thanks jvrothjr! This topic is solved! Link to comment https://forums.phpfreaks.com/topic/60617-solved-how-to-add-distinct-to-this/#findComment-301612 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.