我看到几个回答说“解决你的问题”,但我看到了
GROUP BY CONCAT
在我的查询中,不确定如何修复它。
cur.execute('''
SELECT user_id, symbol FROM first_sweep
WHERE date_time BETWEEN %s AND %s AND action = 'buy'
GROUP BY CONCAT(user_id, "-",symbol)
''', (min_rng, max_rng,))
fs = cur.fetchall()
我得到的全部错误是:
(1055, "Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'stockpicker.first_sweep.user_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by")
我使用的是Ubuntu18.04、MySQL5.7和python 2.7