更新时间:2022-02-19 23:12:53
通过与HAVING
子句组合进行分组来获取它们.这在HSQLDB中也应该起作用. HAVING
子句从行不包含多个行的结果中删除所有数据.当您有一个包含4列的表时,必须采用该语句.
Get them by grouping in combination with a HAVING
clause. This should also work in HSQLDB. The HAVING
clause removes all data from result a rows isn't contained multiple. When you have a table with 4 columns you have to adopt the statement.
SELECT Column1,Column2,Column3 FROM Table GROUP BY Column1,Column2,Column3 HAVING COUNT(*)>1
编辑:已获取所有行
SELECT x.* FROM Table x INNER JOIN (
SELECT Column1,Column2,Column3 FROM Table GROUP BY Column1,Column2,Column3 HAVING COUNT(*)>1
) y ON x.Column1=y.Column1 AND x.Column2=y.Column2 AND x.Column3=y.Column3