Here is the query. I need to pull only rows with DISTINCT column 'type'. How can I do this?
$mathex = "(purchased-used)";
$ads = mysql_query("SELECT $mathex AS difference, ad_id, type, body, purchased, used, date FROM ads HAVING difference>0 ORDER BY difference LIMIT 4",$connection);
Thanks
Ryan