By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,668 Members | 1,503 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,668 IT Pros & Developers. It's quick & easy.

please suggest whether this table contains duplicate records

P: 1
Hi,
The following table namely elcbtripselect [contains no primay key ]contains 5147 records.I want to know wether this table contains duplicate records or not.
I tried with following query
1)SELECT elcbtripselect.ELCBTRIP_voltsMIN, elcbtripselect.ELCBTRIP_voltsMAX, elcbtripselect.ELCBTrip_is_partwinding, elcbtripselect.ELCBTrip_is_ydelta, elcbtripselect.ELCBTRIP_starter_size, elcbtripselect.ELCBTRIP_UnitFunction, elcbtripselect.ELCBTRIP_strcb_speedi_frame_ty, elcbtripselect.ELCBTRIP_cb_style, elcbtripselect.ELCBTRIP_ol_relay_type, elcbtripselect.ELCBTRIP_fla_min, elcbtripselect.ELCBTRIP_fla_max, elcbtripselect.ELCBTrip_Speedi_ECM, elcbtripselect.ELCBTRIP_cb_trip
FROM elcbtripselect;
The result is 5147
Then by using Distinct
2)SELECT distinct elcbtripselect.ELCBTRIP_voltsMIN, elcbtripselect.ELCBTRIP_voltsMAX, elcbtripselect.ELCBTrip_is_partwinding, elcbtripselect.ELCBTrip_is_ydelta, elcbtripselect.ELCBTRIP_starter_size, elcbtripselect.ELCBTRIP_UnitFunction, elcbtripselect.ELCBTRIP_strcb_speedi_frame_ty, elcbtripselect.ELCBTRIP_cb_style, elcbtripselect.ELCBTRIP_ol_relay_type, elcbtripselect.ELCBTRIP_fla_min, elcbtripselect.ELCBTRIP_fla_max, elcbtripselect.ELCBTrip_Speedi_ECM, elcbtripselect.ELCBTRIP_cb_trip
FROM elcbtripselect;
The result is 5145
It means that it contains 2 duplicate records.
Now I executed following query to find duplicate records
3)SELECT elcbtripselect.ELCBTRIP_voltsMIN, elcbtripselect.ELCBTRIP_voltsMAX, elcbtripselect.ELCBTrip_is_partwinding, elcbtripselect.ELCBTrip_is_ydelta, elcbtripselect.ELCBTRIP_starter_size, elcbtripselect.ELCBTRIP_UnitFunction, elcbtripselect.ELCBTRIP_strcb_speedi_frame_ty, elcbtripselect.ELCBTRIP_cb_style, elcbtripselect.ELCBTRIP_ol_relay_type, elcbtripselect.ELCBTRIP_fla_min, elcbtripselect.ELCBTRIP_fla_max, elcbtripselect.ELCBTrip_Speedi_ECM, elcbtripselect.ELCBTRIP_cb_trip
FROM elcbtripselect
Group By elcbtripselect.ELCBTRIP_voltsMIN, elcbtripselect.ELCBTRIP_voltsMAX, elcbtripselect.ELCBTrip_is_partwinding, elcbtripselect.ELCBTrip_is_ydelta, elcbtripselect.ELCBTRIP_starter_size, elcbtripselect.ELCBTRIP_UnitFunction, elcbtripselect.ELCBTRIP_strcb_speedi_frame_ty, elcbtripselect.ELCBTRIP_cb_style, elcbtripselect.ELCBTRIP_ol_relay_type, elcbtripselect.ELCBTRIP_fla_min, elcbtripselect.ELCBTRIP_fla_max, elcbtripselect.ELCBTrip_Speedi_ECM, elcbtripselect.ELCBTRIP_cb_trip
having Count (*) >1
result: I got 2 records but they are having different values.
Please suggest me whether this table is having duplicate records or teel me wats the problem with this.
Herewith I have attached table[elcbtripselect] with 5147 records.


Thanks,
Nethra.
May 26 '07 #1
Share this Question
Share on Google+
2 Replies


debasisdas
Expert 5K+
P: 8,127
may i know please what is the database u r using, for my reference.
May 28 '07 #2

pbmods
Expert 5K+
P: 5,821
result: I got 2 records but they are having different values.

Exactly. Those are your duplicate values.
May 29 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.