I have this query
select name, max(sales),max(buy) from trades group by name
I want the query to display the "Type (sale or Buy)", max(buy) or max(sale) ONLY when the value is not 0
as seen below
as you see above John has Max(sale) != 0 and max(buy) != 0 but in Tim's case, max(sale) is 0 so I haven't displayed it ,,,
so, please how could i generate a query to solve such case !!!!