473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

retrieve duplicates

6
hai all,

Can any one pls send me query on the following.

I have a table product_tbl where the data will be stored like

ProductID Productname
905139078 Modular Substations
905138916 Motor Control Centers
904866565 Modular Substations

The productid is the unique one but the productname is duplicate.

I want to retrieve the duplicate values like...

ProductID Productname
905139078 Modular Substations
904866565 Modular Substations

Can any one pls respond...
Jan 11 '08 #1
1 1017
amitpatel66
2,367 Expert 2GB
hai all,

Can any one pls send me query on the following.

I have a table product_tbl where the data will be stored like

ProductID Productname
905139078 Modular Substations
905138916 Motor Control Centers
904866565 Modular Substations

The productid is the unique one but the productname is duplicate.

I want to retrieve the duplicate values like...

ProductID Productname
905139078 Modular Substations
904866565 Modular Substations

Can any one pls respond...
Try out this query:
Expand|Select|Wrap|Line Numbers
  1. SELECT y.productid,y.productname FROM
  2. (SELECT count(productid) cnt,productname from product_tbl group by productname) x, product_tbl y
  3. WHERE x.productname = y.productname
  4. AND cnt >= 2
  5.  
Jan 12 '08 #2

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

Similar topics

2
by: Randy Jackson | last post by:
First of all, I apologize in advance if this is covered somewhere in a FAQ. I did a Google search, but really couldn't find anything. I'm having a problem with a simple select query. I've got...
1
by: TimG | last post by:
There is a table with a single column with 75 rows - 50 unique / 25 duplicates. How would pull back a list of the rows that have/are duplicates? This is a question that I got in an interview. I...
6
by: Marlene | last post by:
Hi All I have the following scenario, where I have found all the duplicates in a table, based on an order number and a part number (item).I might have something like this: Order PODate Rec...
3
by: Deano | last post by:
SELECT id, department FROM tblAssets UNION SELECT 0 AS id, "{All departments}" AS department FROM tblAssets; UNION SELECT 0 AS id, "{All departments}" AS department FROM tblAssets; This gives me...
1
by: Neil | last post by:
Hello everyone, I am making a program at the moment, and need HELP!!!. I'll start with the database, my field's r: fldSku - which a 6 digit number, no more no less (145682) fldDescription - which...
3
by: AK | last post by:
Hi Our product uses MS-SQL Server 2000. One of our customer has 10 installations with each installation stroring data in its own database. Now the customer wants to consolidate these databases...
3
by: ryan.paquette | last post by:
In the table there are 2 fields in which I wish to limit (i.e. No Duplicates) Although I do not want to limit them to "No Duplicates" separately. I need them to be limited to "No Duplicates" as...
1
by: tskmjk55 | last post by:
Recently, I have a requirement to develop a vb.net application wherein the input excel sheet data which has an average of 5000 records should be checked for Internal duplicates (duplicates within the...
3
Thekid
by: Thekid | last post by:
I'm trying to figure out a way to find if there are duplicates in an array. My idea was to take the array as 'a' and make a second array as 'b' and remove the duplicates from 'b' using 'set' and then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.