• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

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]
 
Marshal
Posts: 26087
71
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic