I have created table :
CREATE TABLE `testForGroupBy` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`empId` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
Data insetrted :
when I query,
select * from (select * from testForGroupBy order by empId desc)a group by name;
Expeceted :
I googled and found that 5.7 will not work for the partial groupby to make it works need to change sql_mode
like below and restarted,
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
But still the same result!
Where am I doing a mistake ?