In a MySql select statement involving aggregation, is it possible to select just the grouped by column without the aggregate?
Basically I want to select IDs in subquery according to a criteria based on an aggregate, in this case the total payments to a client:
select idclient, business_name from client where idclient in
(
  select idclient, sum(amount) as total 
  from payment 
  group by idclient
  having total > 100
)
... but this fails with error Operand should contain 1 column(s) because the subquery selects both the id (which I want) and the total (which I don't). Can I exclude total from the subquery result in any way?
Edit: if possible I would prefer to avoid using a join - the where clause is being passed onto another existing function on its own.
Apologies if this is a dupe - I did search, honest. I couldn't find an exact answer in the mass of SQL aggregate questions.
 
     
     
    