sql_language thread: Re: [Re: How to Elimination Duplicate Rows? (distinct one of the column)]
Hi Don,
Hey, it works!!!!!!!!!
The reason I want it, because we have bad data issues, and it is killing
our
database by pulling too many duplicated rows, and user only care about
document ID. The address info just for verify if the document is the righ
t
one.
Millions of thanks,
Li Li
"Don DeYoung" <deyoung@m...> wrote:
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
> =3D3D
> ?
>
> I used "distinct" in SQL statement join a few tables (Oracle), I got
data=3D
> =3D3D
>
> return like:
>
> DocID CompanyName Address Parish State =3D
>
>
> 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=3D
> d
> don't care which row.
>
> Fow example, I want result to be only one row for each DocID.
>
> Anyone can help?
>
> Li Li =3D
>
>
>