• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

delete from table

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi friends..i hav one problem.
say i hav one table "emp_name" that contains 100 records but most of the records are duplicate for example
s
s
s
a
b
c
d
e
f
a
d
a
a
s
f
c
c
.....this way it stores hundered records.
now i want to delete all the duplicate records means i want only one entry against "a" and all other "a" should be deleted ..wats the query for this...
thanks in advance.
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
by using groupby and having count.
check this out too:
http://15seconds.com/issue/011009.htm
good luck!
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this a relational table (Oracle maybe)?
If so then you can select rowid and delete the min or max row id having a count > 1.
reply
    Bookmark Topic Watch Topic
  • New Topic