Hello Tom,

Tom Lane wrote:

T E Schmitz <[EMAIL PROTECTED]> writes:

This is *almost* what I need:


SELECT
BRAND.BRAND_NAME,
MODEL.MODEL_NAME,
min (ITEM.PRICE),max (ITEM.PRICE)
*min (CONDITION.POSITION),max (CONDITION.POSITION)*
FROM ITEM
left outer join MODEL  on MODEL_PK =ITEM.MODEL_FK
left outer join BRAND  on BRAND.BRAND_PK =MODEL.BRAND_FK
left outer join CONDITION on CONDITION.CONDITION_PK = ITEM.CONDITION_FK
group by BRAND.BRAND_NAME,MODEL.MODEL_NAME


In the result I don't want min/max(POSITION) but CONDITION.NAME of min and max(POSITION) for each MODEL.


<snip>
(select name from condition c1 where position = min(condition.position)),
(select name from condition c2 where position = max(condition.position)),
<snip>

Thank you, Tom, this worked a treat!

--


Regards/Gruß,

Tarlika Elisabeth Schmitz

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
     subscribe-nomail command to [EMAIL PROTECTED] so that your
     message can get through to the mailing list cleanly

Reply via email to