Person Posted May 4, 2007 Share Posted May 4, 2007 whats wrong with this query? SELECT user, sum(imps) AS imps, sum(clicks) AS clicks, sum(clientrev) AS clientrev FROM nuke_pnAffiliate_unauditedstats WHERE `date` = '20070418' AND sid like '%rpu%' AND user IN (SELECT DISTINCT(cl) FROM rpu_sales WHERE salesman = 'ryan') GROUP BY client ORDER BY clientrev DESC; thanks Link to comment https://forums.phpfreaks.com/topic/49918-quick-query-question/ Share on other sites More sharing options...
btherl Posted May 4, 2007 Share Posted May 4, 2007 Can you show us the error from mysql rather than making us guess? Link to comment https://forums.phpfreaks.com/topic/49918-quick-query-question/#findComment-245003 Share on other sites More sharing options...
btherl Posted May 4, 2007 Share Posted May 4, 2007 Without knowing your table structure and the purpose of the query, the only odd thing I notice is that you select user, but you group by client. Normally you will select the column you group by. Link to comment https://forums.phpfreaks.com/topic/49918-quick-query-question/#findComment-245004 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.