dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

DROP TABLE IF EXISTS `OrderItemsTWO`;
CREATE TABLE IF NOT EXISTS `OrderItemsTWO`(
    order_num VARCHAR(255) NOT NULL COMMENT '商品订单号',
    quantity INT(255) NOT NULL COMMENT '商品数量'
);
INSERT `OrderItemsTWO` VALUES ('a1',105),('a2',200),('a4',1121),('a5',10),('a7',5);

select * from OrderItemsTWO group by order_num having sum(quantity)>=100 order by order_num;

问题一:Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test_jdbc.OrderItemsTWO.quantity' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

你可能感兴趣的:(MySQL,数据库)