0

Here is query

SELECT 
ap_sell_investment.sell_per_coin,ap_sell_investment.sell_id, ap_sell_investment.sell_no_of_coins, ap_investment.investment_id,ap_investment.currency_price_input, ap_coin_currency_mst.coin_currency_price ,ap_coin_currency_mst.symbol, ap_investment.write_note, ap_investment.pstatus, ap_investment.coin_currency_id 
FROM 
ap_sell_investment 
INNER JOIN ap_investment 
ON ap_investment.coin_currency_id = ap_sell_investment.coin_currency_id 
INNER JOIN ap_coin_currency_mst 
ON ap_coin_currency_mst.coin_currency_id = ap_investment.coin_currency_id 
WHERE ap_investment.status=2 
GROUP BY ap_sell_investment.sell_id

I got this error

Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'fl_coinbase_new.ap_investment.investment_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group

Naim Malek
  • 1,186
  • 1
  • 11
  • 21
Parth Ganatra
  • 138
  • 12
  • 1
    When `only_full_group` mode is enabled and you group by `sell_id`, then the only things you can select are `sell_id` or another column wrapped in an aggregate function, such as `SUM` or `AVG`. But besides this, it isn't even clear to me why you are aggregating on the `sell_id`, since you do not use any aggregate functions. Please provide some sample input and output which makes it clear what you are trying to do here. – Tim Biegeleisen Nov 16 '17 at 13:26
  • 1
    Yes the "group by" here, doesn't follow the SQL rules : You have to Goup BY all the columns in the select that's not aggregate function (SUM, AVG, Count) – Daniel E. Nov 16 '17 at 13:46
  • 1
    Possible duplicate of [Disable ONLY\_FULL\_GROUP\_BY](https://stackoverflow.com/questions/23921117/disable-only-full-group-by) – Abdulla Nilam Nov 17 '17 at 05:25
  • Yes, Abdulla Nilam. It works https://stackoverflow.com/questions/23921117/disable-only-full-group-by – Parth Ganatra Dec 17 '21 at 12:07

0 Answers0