Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
12-16-2012, 04:11 AM #1
- Join Date
- Dec 2012
- Thanked 0 Times in 0 Posts
Duplicate Records only where a specific condition exists
I have a table containing Display Text, A Link Field, and a Category.
I am trying to find duplicate links, BUT only if they have the same Category.
Right now I am using a query that shows me all duplicates regardless of the category they are in. Can anyone help me figure out the missing piece for the same category part?
Here is my query:
SELECT * FROM patterns WHERE lnktxt IN ( SELECT lnktxt FROM patterns GROUP BY lnktxt HAVING count( lnktxt ) >1 ) ORDER BY lnktxt
12-17-2012, 02:05 AM #2
???Code:SELECT P1.some, P1.fields FROM patterns AS P1, ( SELECT lnktxt, category, COUNT(*) AS howmany FROM patterns GROUP BY linktxt, category HAVING howmany > 1 ) AS P2 WHERE P1.lnktxt = P2.lnktxt AND P1.category = P2.category
If I understood what you were saying.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Users who have thanked Old Pedant for this post: