|
|
sybperl-l Archive
Up Prev Next
From: Charles Zhao <charles dot zhao-next at attws dot com>
Subject: A Way Side Question
Date: Aug 25 1999 12:12AM
Well, this is not a DBLib question. It's a pure SQL question, but since we
all deal with SQL, you might have good ideas:
I have table with records like this:
WHAT COLOR SEX ...
==============================
cat black male ...
bird red male ...
cat white female ...
cat grey female ...
cat black male ...
bird white female ...
I need to select records from this table with distinct combinations of the
above 3 columns. Thus duplicate rows like "cat black male ..." will be
eliminated from my selection. How can do it?
1. "select distinct * from .." is not a choice;
2. How does this work: "select distinct WHAT, distinct COLOR, distinct SEX
from ..."?
Thanks
Charles Zhao
|