由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Re: How to find a duplicate record in Ac
相关主题
这种insert怎么做how to find duplicates in mysql
[合集] 这种insert怎么做A weird error
urgent help! insert value into tableMySQL 的一个问题求教
Remove duplicate from oracle tablelist duplicators in one table
a sql question吃了包子, 幹活了!
请教一下高手,包子答谢!讨论:在SELECT中限制TOP N条纪录
怎么去除duplicatesWhich design is better?
MySQL语句请教better solution for cross table query in sql?
相关话题的讨论汇总
话题: columna话题: select话题: ac话题: duplicates话题: count
进入Database版参与讨论
1 (共1页)
x***n
发帖数: 39
1
Suppose the primary key you wanna set is MyTable.ColumnA
Then
SELECT MAX(Duplicates), ColumnA
FROM
( SELECT COUNT(*) AS Duplicates, ColumnA
FROM MyTable
GROUP BY ColumnA);
b*e
发帖数: 3845
2
maybe this would be better
select count(*) as dup, columnA from myTable group by ColumnA
having dup>1

【在 x***n 的大作中提到】
: Suppose the primary key you wanna set is MyTable.ColumnA
: Then
: SELECT MAX(Duplicates), ColumnA
: FROM
: ( SELECT COUNT(*) AS Duplicates, ColumnA
: FROM MyTable
: GROUP BY ColumnA);

c**t
发帖数: 2744
3
Why need nested w-c?
select count(*), ColumnA
from TABLE
group by ColumnA
having count(*) > 1

【在 x***n 的大作中提到】
: Suppose the primary key you wanna set is MyTable.ColumnA
: Then
: SELECT MAX(Duplicates), ColumnA
: FROM
: ( SELECT COUNT(*) AS Duplicates, ColumnA
: FROM MyTable
: GROUP BY ColumnA);

1 (共1页)
进入Database版参与讨论
相关主题
better solution for cross table query in sql?a sql question
SQL help.请教一下高手,包子答谢!
how to write this sql statement怎么去除duplicates
How to find a duplicate record in Access?MySQL语句请教
这种insert怎么做how to find duplicates in mysql
[合集] 这种insert怎么做A weird error
urgent help! insert value into tableMySQL 的一个问题求教
Remove duplicate from oracle tablelist duplicators in one table
相关话题的讨论汇总
话题: columna话题: select话题: ac话题: duplicates话题: count