Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'bioman.A.pos' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
select SP.*,A.pos as a_pos,sum(FL.quantity) as sm from catalog_stack_products as SP,catalog_stack_alternatives as A,catalog_products_flavors as FL where A.product_id=5738 and A.product_entry_id=SP.id and SP.product_id=FL.product_id group by SP.id having sm < SP.quantity