-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Delete duplicate Entry's on Database level
PostPosted: Tue Jan 20, 2009 9:08 am 
Newbie

Joined: Mon Jan 19, 2009 6:11 am
Posts: 5
Hi,
i want to delete some entries from a table. The table looks as follows:

Title:

- key long,
- name String,

the key is different for every entry in the table, but now i want to delete all rows with the same name ( 1 row of each title.name should be left over)!

would it be better to add a unique constraint to "name" ?

is it possible to delete them on a database level like:

delete from Title using Title title1, t2 where title1.name = title2.name

I know, it would be easy to check this on a java-level but at this time it tooks too much time!

thanks in advance
gerb


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.