Here is the solution,
step 1.
create table items(product varchar(15),price money,brand varchar(15))
Step2
Insert the data
Issue the query as
select * from items a
where exists ( select 1
from items b
where a.product = b.product
and a.price =b.price
and a.brand = b.brand
group by product, price, brand
having count(1) > 1 )
Regards,
Qadri
> Hi,
I have a table
Table 1:
Product Price Brand
----------------------
Shoe 2000 Nike
Shoe 3000 addidas
shoe 2000 Nike
Camera 5000 Canon
Camera 5000 Canon
Camera 4000 Olympus
I need to check whether the product , price and brand are same and then
report only those value.
Output
Product Price Brand
----------------------
Shoe 2000 Nike
Shoe 2000 Nike
Camera 5000 Canon
Camera 5000 Canon
There will be n number of products like this. I tried using 'group by'.
But i was not able to get the result properly.
Can anyone help me in this.
Regards,
Shankar
__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/