使用 java 在 sql 中查找具有相同数据的相同值的行?
Finding the rows with same values having same data in sql using java?
从 table 中,因为我想获取包含作品最小值的行,因为这里是 3,所以我可以获得 id 2 和 5 的行,因为这两行具有相同的最小值。
ID | emailID | works
------------------------------------------
1 | tree123@gmail.com | 5
2 | tree23@gmail.com | 3
3 | hello123@gmail.com | 5
4 | thistree123@gmail.com | 4
5 | somtng@gmail.com | 3
"I want to get the rows that contain the minimum value of works" - 您可以通过执行以下操作获得:
SELECT emailId
FROM yourTable
WHERE works = (SELECT MIN(works)
FROM yourTable)
下面是这个查询的实际演示:SQL Fiddle
如果这不是您要查找的内容,请详细说明您的问题。
从 table 中,因为我想获取包含作品最小值的行,因为这里是 3,所以我可以获得 id 2 和 5 的行,因为这两行具有相同的最小值。
ID | emailID | works
------------------------------------------
1 | tree123@gmail.com | 5
2 | tree23@gmail.com | 3
3 | hello123@gmail.com | 5
4 | thistree123@gmail.com | 4
5 | somtng@gmail.com | 3
"I want to get the rows that contain the minimum value of works" - 您可以通过执行以下操作获得:
SELECT emailId
FROM yourTable
WHERE works = (SELECT MIN(works)
FROM yourTable)
下面是这个查询的实际演示:SQL Fiddle
如果这不是您要查找的内容,请详细说明您的问题。