• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Trying to delete duplicates from tables with relationship

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys

Can I be assisted here?


What I want to is to delete Row 2 which is the same as in Row 1. When you look at the ComplaintNumber you will notice there is a duplicate of Complaint. But when i try to delete the duplicate it complaints about the child table which is in CASE table. Even there I can delete because even the Child Table has a relationship with other tables in the same Database.

I also posted this question on Stack Overflow; https://stackoverflow.com/questions/58952607/trying-to-delete-duplicates-from-tables-with-relationship

Thanks in advance for your responses.

Kind regards
Attie
First.JPG
[Thumbnail for First.JPG]
Second.JPG
[Thumbnail for Second.JPG]
 
Sheriff
Posts: 24754
59
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Athenkosi!

It would help if you started by explaining what you mean by "duplicate cases" and also what it means to delete those cases.

My guess is that you don't actually want to delete anything from the database, you just want a different query which shows fewer rows.

I'm also guessing that, for example, you consider Rows 1 and 2 of the output of the working query to be "duplicate cases" because they both have the same case number. However I'm unable to guess whether you just want to show one of them (and if so, which one) or whether you don't want to show either of them.

But guessing isn't that useful. So go ahead and clarify your question.
 
Tell me how it all turns out. Here is a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!