Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: How to Elimination Duplicate Rows? (distinct one of the column)


Message #1 by Li Li <lilinola@u...> on 25 Mar 2001 11:26:13 EST
If you truly don't care what you get for the other columns, why ask for 
it?  But anyway, this will work.

select docid, min(companyname) as companyname, min(address) as address, 
  min(parish) as parish, min(state) as state 
  from doc_table
  group by docid


Sorry about the previous misfire.

Don
__________________________________________
MODERATOR: S'okay! Misfires are one of the
(many) reasons we moderate! :)
__________________________________________

> Hi Everyone,
> 
> Anyone knows how to select many columns but only make one column 
distinct
> =3D
> ?
> 
> I used "distinct" in SQL statement join a few tables (Oracle), I got 
data
> =3D
> 
> return like:
> 
> DocID CompanyName Address Parish State 
> 
> 
> 1234 Shell Corp. P.O. Box# Jefferson LA
> 1234 Shell Corp. HW 1 LA
> 1234 Shell Corp. P.O. Box# Jefferson
> 
> But I only want distinct DocID, but I need display the other info too, 
an
> d
> don't care which row.
> 
> Fow example, I want result to be only one row for each DocID.
> 
> Anyone can help?
> 
> Li Li 
> 
> 
> 

  Return to Index