473,320 Members | 1,883 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,320 software developers and data experts.

retrieve duplicates

6
Hai,

I am having a table with name product_tbl wherin two columns exists productname and productgroup. Can u please give me a query wherin i can retrieve values of same in the two columns.

Thanks
Oct 6 '07 #1
10 1389
azimmer
200 Expert 100+
Hai,

I am having a table with name product_tbl wherin two columns exists productname and productgroup. Can u please give me a query wherin i can retrieve values of same in the two columns.

Thanks
Expand|Select|Wrap|Line Numbers
  1. SELECT productname
  2. FROM product_tbl
  3. WHERE productname=productgroup
  4.  
Oct 6 '07 #2
hganta
6
Expand|Select|Wrap|Line Numbers
  1. SELECT productname
  2. FROM product_tbl
  3. WHERE productname=productgroup
  4.  
HI,

Thanks for ur response

But my query is not for the same row in the columns. The productname of one row will be matched with another row of the productgroup in the table product_tbl. Can u please give me the extended one....

Thanks
Oct 6 '07 #3
hganta
6
HI,

I have a table product_tbl in which two columns exists. productname and productgroup. The productname of one row will be matched with another row of the productgroup in the table product_tbl. Can u please give me the query on this one....

Thanks
Oct 7 '07 #4
azimmer
200 Expert 100+
HI,

Thanks for ur response

But my query is not for the same row in the columns. The productname of one row will be matched with another row of the productgroup in the table product_tbl. Can u please give me the extended one....

Thanks
You mean it's like this:

Product Productgroup
A Something
... ...
B A
... ...
Oct 7 '07 #5
debasisdas
8,127 Expert 4TB
both the threads a re merged.
Oct 9 '07 #6
iburyak
1,017 Expert 512MB
You should show example of data and desired result.
By your brief description it is hard to tell what is requested.

Thank you.
Oct 9 '07 #7
jamesd0142
469 256MB
Hai,

I am having a table with name product_tbl wherin two columns exists productname and productgroup. Can u please give me a query wherin i can retrieve values of same in the two columns.

Thanks
SELECT <columnName>
COUNT(<columnName>) AS NumOccurrences
FROM <databasename>
GROUP BY <columnName>
HAVING (COUNT(<columnName>)>1)
Oct 9 '07 #8
Motoma
3,237 Expert 2GB
Hai,

I am having a table with name product_tbl wherin two columns exists productname and productgroup. Can u please give me a query wherin i can retrieve values of same in the two columns.

Thanks
Hi Hganta,
I hope you have found the responses in this thread useful. If you still have not received an answer which performs the task you are looking for, please consider giving us a sample data set along with the result you are looking to get from it.
Oct 9 '07 #9
hganta
6
Product Productgroup
XYZ ABC
... ...
MNK XYZ

s exactly that is what i mean.

please provide me the query on this.

I want to retrive the XYZ cases both in product and productgroup.
Oct 9 '07 #10
iburyak
1,017 Expert 512MB
To find duplicates in a table do following:

select productname, productgroup, count(*)
from product_tbl
group by productname, productgroup
having count(*) > 1

Good Luck.
Oct 9 '07 #11

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: hganta | last post by:
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...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.