Home > database >  SQL statements don't know where is wrong
SQL statements don't know where is wrong

Time:10-06



 insert into student (num, name, age, id) values (11, 'three', 6, 6); 
Insert into student (num, name, age, id) values (21, 'four', 6, 2);
Insert into student (num, name, age, id) values (31, 'five', 6, 1);
Insert into student (num, name, age, id) values (41, 'six', 6, 4);
Insert into student (num, name, age, id) values (51, 'three', 7, 3);
Insert into student (num, name, age, id) values (61, 'three', 6, 8).
Insert into student (num, name, age, id) values (71, 'five', 6, 7);
Insert into student (num, name, age, id) values (81, 'four', 6, 5);

CodePudding user response:



So that you can, not in that way

CodePudding user response:

No one to help us solve this problem???????????

CodePudding user response:

MySQL does not support the update, delete query this table in table son name
Consider using a temporary table/variables

CodePudding user response:

Try this
 DELETE 
The FROM
Student
WHERE id NOT IN
(SELECT
Id
The FROM
(SELECT
MAX (num) id
The FROM
Student
GROUP BY NAME,
Age) t1)
  • Related