Saturday, 24 August 2013

how can i remove duplicate values by using distinct keyword

how can i remove duplicate values by using distinct keyword

I've a table with records like this
*************************** 1. row *************************
did: 98
brand_name: Aarther P (100+500)
generic: Paracetamol, Aceclofenac
tradename: Aarther P (100+500)
manfactured: Rekvina Pharmaceuticals
unit: 500mg/100mg
type: Tablet
quantity: 10Tablet
price: 27.9
*************************** 2. row *************************
did: 99
brand_name: Aarther-P
generic: Aceclofenac, Paracetamol
tradename: Aarther-P
manfactured: Rekvina Pharmaceuticals
unit: 100mg/500mg
type: Tablet
quantity: 10Tablet
price: 27.9
*************************** 3. row ************************
did: 100
brand_name: Aarticef (1000mg)
generic: NULL
tradename: Aarticef (1000mg)
manfactured: Alpic Remedies Ltd
unit: 1000mg/vial
type: Injection
quantity: 1Vial
price: 96
I want to eliminate duplicate manfactured names,for that i have executed
the following query
select brand_name,generic,manfactured from drugs_info group by manfactured;
but it displaying 1st and 3rd records only like follow, but i want 2nd record
*************************** 1. row *************************
did: 98
brand_name: Aarther P (100+500)
generic: Paracetamol, Aceclofenac
tradename: Aarther P (100+500)
manfactured: Rekvina Pharmaceuticals
unit: 500mg/100mg
type: Tablet
quantity: 10Tablet
price: 27.9
*************************** 3. row ************************
did: 100
brand_name: Aarticef (1000mg)
generic: NULL
tradename: Aarticef (1000mg)
manfactured: Alpic Remedies Ltd
unit: 1000mg/vial
type: Injection
quantity: 1Vial
price: 96
how can i write select query for my requirement.please help me..

No comments:

Post a Comment