在数据库中显示欺骗 [英] Showing dupes in Database

查看:65
本文介绍了在数据库中显示欺骗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在查询数据库时遇到问题。这是一个名字&地址数据库包含firstname,lastname,email等列。我试图在我的20,000名称数据库中显示dupes。我写了一个显示欺骗的查询。例如,如果有10个电子邮件地址为 john@john.net ,则我的输出仅显示该条目一次。我想要做的是输出所有的欺骗,所以我可以编辑或删除它们。此外,另一部分是我想输出所有与名字和姓氏匹配的dupes(双列查询)。也就是说,输出将显示John Smith的所有欺骗以及Bill Smith的所有欺骗,而不仅仅是所有Smiths。

这是我的查询,只显示每个电子邮件的一个实例(单列查询) 。它没有显示每个dupes实例。

I am having trouble with a query for my database. It is a name & address database with columns like firstname, lastname, email, etc. I am trying to show dupes in my 20,000 name database. I have written a query that shows the dupes. For example, if there are 10 email addresses as john@john.net, my output only shows that entry once. What I would like to do is output all the dupes, so I can edit or delete them. Also, another part of this is that I would like to output all dupes that match first name and last name (double column query). That is, the output would show all dupes for John Smith and all dupes for Bill Smith, not just all the Smiths.
Here is my query that shows only one instance of each email (single column query). It does not show each instance of dupes.

展开 | 选择 | Wrap | 行号

推荐答案

那是因为你通过电子邮件进行分组。

这与DISTINCT相同。

看不出有任何理由使用GROUP BY
That is because you are GROUPing by email.
This works the same as DISTINCT.
Can''t see any reason to use GROUP BY



那是因为你通过电子邮件进行分组。

这和DISTINCT一样。

看不到任何原因是使用GROUP BY
That is because you are GROUPing by email.
This works the same as DISTINCT.
Can''t see any reason to use GROUP BY



那么,查询的外观是什么样的?如上所述的双列查询?

So, what would the query look like for a double column query as described above?


我不确定双列查询的含义。

但是如果你使用GROUP BY或DISTINCT,你只会返回唯一记录。

表中有ID吗?你应该养成使用INT ids的习惯,即使你没有立即使用它们。

我对这些名字感到困惑。

你有不同的重复电子邮件吗?名称?

有多种方法可以删除重复项,子查询是最明显的例子。

如果你能给我表格结构以及你要找的结果它会有帮助
I am not sure what you mean by double column query.
But if you use GROUP BY or DISTINCT you will only return unique records.
Have you got IDs in the table. You should get into the habit of using INT ids even if you see no immediate use for them.
I am confused about the names.
Do you have duplicate emails under different names?
There are varying methods to remove duplicates, a sub-query is the clearest example.
if you could give me the table construction and what result you are looking for it will help


这篇关于在数据库中显示欺骗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆