duplicates

Removing elements based on child elements XSLT

I am new to Stack Overflow and to XSLT. I have a problem with removing duplicate entries from the output, based on some child element conditions. Here is an example of XML that I have: <partyorders> <order> <day>12</day> <month>05</month> <year>2000</year> <amount>5000.00</amount> ...

Remove objects from NSMutable array that match with objects from another NSMutable Array

Ok so: i have NSMutableArray 1 i also have NSMutableArray 2 I would like to remove all objects from array 1 that match with objects in array 2. Any ideas? Thanks! ...

JPA Merge Is Causing Duplicates

I have the entity classes below. When a user first signs up, only the username and password are supplied, so the list of accounts (think profiles) is empty. Later, when they add an account, the user object is updated in the client, passed to the server, and then entityManager.merge(user) is called. When the user is merged, the account...

Eliminate Duplicate Entries

I am using the following javascript to dynamically load the contents of an external page within the parent page. The external page is within the same domain as the parent page and queries a database for blog entries. I am using the variable "eeOffset" to pass a value into the database query in the external page to offset the results retu...

mysql duplicates with LOAD DATA INFILE

Hi... When using LOAD DATA INFILE, is there a way to either flag a duplicate row, or dump any/all duplicates into a separate table? ...

MySQL Multiple Join/Subquery Questions

Hi All, For about a year now, we’ve been allowing our users to login with usernames and/or email addresses that are not unique (though each user does have a unique id). Although the system handles duplicate usernames/emails elegantly, we’ve decided to finally enforce unique usernames and email addresses. I’ve been tasked with generati...

Best way to know when users register duplicated links (MYSQL + PHP)

so i have a page where a user can submit his own links i dont want to make a script that do everything automatic, i just want to make a page where, when the .php find a possible duplicated link, i get a warning like "ID 22 could possible have the same link as ID 738" i only need like the query to do that...if its possible with that..i ...

Django: Filtering on the related object, removing duplicates from the result

Given the following models: class Blog(models.Model): name = models.CharField() class Entry(models.Model): blog = models.ForeignKey(Blog) content = models.CharField() I am looking to pass the following to a template: blogs = Blog.objects.filter(entry__content__contains = 'foo') result = [(blog, blog.entry_set.filter(con...

How to show only one duplicate?

This is kind of an extension of this question of mysql not in or value=0? I have two databases one has the widget information and the other is the layout of those widgets according to the module. On the page I have lists to put these widget such as Header, Content, Sidebar, and Footer. There is also a list of widget that are not being u...

How can you efficiently remove duplicate characters from a string?

Is it possible to remove duplicate characters from a string without saving each character you've seen in an array and checking to see if new characters are already in that array? That seems highly inefficient. Surely there must be a quicker method? ...

Problem removing duplicate files using awk

Contents of part3.1.awk { current_line=$0 if (current_line!=prev) { print $1 " -> " " -> " $5 " -> " $8 } prev=$0 } To get the list of processes, i run this in terminal. I want to get output with removed duplicates and sorted too. $ps -ef | awk -f part3.1.awk | sort What wrong am i doing? ...

I'm getting 'Duplicate id error' after adding 'binding' attribute

Here is JSF code: <o:chart id="categoryLineChart" model="#{categoryReports.categoriesLineChart}" view="line" rendered="#{categoryReports.reportRendered}" height="#{categoryReports.scaleHeight}" width="#{categoryReports.chartWidth}" binding="#{categoryReports.lineChartComponent}"> <o:chartNoDataMe...

Finding duplicate rows in SQL Server

I have a SQL Server database of organizations, and there are many duplicate rows. I want to run a select statement to grab all of these and the amount of dupes, but also return the ids that are associated with each organization. A statement like: SELECT orgName, COUNT(*) AS dupes FROM organizations GROUP BY orgName ...

Grouping fields that partially match in MySQL

I'm trying to return duplicate records in a user table where the fields only partially match, and the matching field contents are arbitrary. I'm not sure if I'm explaining it well, so here is the query I might run to get the duplicate members by some unique field: SELECT MAX(id) FROM members WHERE 1 GROUP BY some_unique_field HAVING COU...

Xsl: Grouping and removing duplicate items

Given the following XML: <interface name="Serial1/0"/> <interface name="Serial2/0.0"/> <interface name="Serial2/0.1"/> <interface name="Serial3/0:0"/> <interface name="Serial3/0:1"/> I am trying to produce the following output: <interface name="Serial1/0"> <unit name="Serial1/0"/> </interface> <interface name="Serial2/0"> <unit n...

SQL search and destroy duplicates

I have a table with fields (simplified): id, fld1, fld2, fld3. id is a numeric primary key field. There are duplicates: id differs but fld1, fld2 and fld3 are identical over 2 or more rows. There are also entries where the values occur only once, i.e. non-duplicates, of course. Of each set of duplicate entries, I want to retain only...

What's the best way to dedupe a table?

I've seen a couple of solutions for this, but I'm wondering what the best and most efficient way is to de-dupe a table. You can use code (SQL, etc.) to illustrate your point, but I'm just looking for basic algorithms. I assumed there would already be a question about this on SO, but I wasn't able to find one, so if it already exists just...

Force MySQL to return duplicates from WHERE IN clause without using JOIN/UNION?

This might not be very sensible, but I'ld like to let MySQL return me the exact duplicate rows if there are duplicate criteria in the WHERE IN clause. Is this possible? Take this example: SELECT columns FROM table WHERE id IN( 1, 2, 3, 4, 5, 1, 2, 5, 5) I'ld like MySQL to return me rows with id 5 three times, id's 1 and 2 tw...

Yahoo! BOSS: Include duplicate results

I can easily get the results I want from Yahoo! BOSS. However, for the particular data I'm trying to get, it's important that "duplicate" results be included. I know Yahoo! has them, since when I search for the query manually, it offers me a link to see these similar results. Is there any way to request these deeper results with the Ya...

Fix DB duplicate entries (MySQL bug)

I'm using MySQL 4.1. Some tables have duplicates entries that go against the constraints. When I try to group rows, MySQL doesn't recognise the rows as being similar. Example: Table A has a column "Name" with the Unique proprety. The table contains one row with the name 'Hach?' and one row with the same name but a square at the end in...