Home » SQL & PL/SQL » SQL & PL/SQL » search redundant record
search redundant record [message #208069] Fri, 08 December 2006 00:48 Go to next message
matrik02
Messages: 64
Registered: November 2005
Member
I have field name 'lot number' . This field i want to set is as primary key and has unique id. The problem is, this field has redundant data. I have 4000 record. So how i can search the redundant data only this field. My table name is 'parcel'. Hopes get and idea from your experties.

[Updated on: Fri, 08 December 2006 00:49]

Report message to a moderator

Re: search redundant record [message #208086 is a reply to message #208069] Fri, 08 December 2006 02:13 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If you just want to see which records have duplicate values:
SELECT lot_number
FROM parcel
HAVING count(*) > 1
GROUP BY lot_number;
Re: search redundant record [message #208156 is a reply to message #208069] Fri, 08 December 2006 06:33 Go to previous messageGo to next message
k7nixen
Messages: 7
Registered: December 2006
Junior Member
SELECT lot_number,count(*)
FROM parcel
GROUP BY lot_number
HAVING count(*) > 1;
Re: search redundant record [message #208175 is a reply to message #208156] Fri, 08 December 2006 07:37 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is called a significant difference ./fa/1601/0/
Previous Topic: plz tell diff. b/w these quries
Next Topic: Array, temp table, loop? Suggestions please.
Goto Forum:
  


Current Time: Sat Dec 10 10:47:38 CST 2016

Total time taken to generate the page: 0.07636 seconds