我想在主题字段中删除相同的值并保留第一行值。
,例如
no topic
1 1234
2 1234
3 1234
no = autoincrement
输出
no topic
1 1234
这是我的代码
$sql ="DELETE FROM data
WHERE no IN (SELECT *
FROM (SELECT no FROM data
GROUP BY topic HAVING (COUNT(*) > 1)
) AS A
)";
此代码删除第一个值,但我想删除所有相同的值并保留第一个值,例如。
答案 0 :(得分:1)
试试这个
@Configuration
public class MyApplicationContext {
@Bean
public DirectoryScanner scanner() {
return new WatchServiceDirectoryScanner("/tmp/myDir");
}
}
@Component
public class MyApplicationContext {
@Bean
public DirectoryScanner scanner() {
return new WatchServiceDirectoryScanner("/tmp/myDir");
}
}