Jeff Schwartz wrote:
> I apologize if this is obvious but I've checked the manual and mail list
> I need several fields of data where one of the fields is distinct. So,
> below, for each unique ename, I want their ename, a_id, and last_mail.
> However, "distinct" is being applied to all fields and I get duplicate
> "select distinct ename, a_id, last_mail from affiliates where
> How can I apply the distinct criteria to a single field but still get
> the data on other fields?
Not sure what it is exactly that you are trying to accomplish, but it
seems to me that you do not need distinct, or even selecting ename at
all - you already know it because of youre WHERE clause. Just do:
select a_id, last_mail from affiliates where ename =
If you want to see only one row, append limit 1 to the query.