Hello,
I am selecting DISTINCT records from a table:
"SELECT DISTINCT Model, Description FROM Warranty"
This works great, but I would like to concatinate some other data in the
returned records (possibly with a JOIN)
From the same table I would like the returned records to return "Family" and
"Price".
So the returned records would be:
Model Description Family Price (with the Model and Description being
Distrinct).
NOTE: There is a Primary Key Called "ID".
Maybe something like:
SELECT DISCTINCT C1.Model, C1.Description FROM Warranty AS C1, Warranty AS
C2 (Select C2.Family, C2.Price FROM C2 ON C1.ID = C2.ID)
Any help is greatly appreciated,
Thanks,
ChuckHi Charles
How about
SELECT Model, Description, MAX(Family) AS [Family], Max(Price) AS [P
rice]
FROM Warranty
GROUP BY Model, Description
John
>
"Charles A. Lackman" wrote:
> Hello,
> I am selecting DISTINCT records from a table:
> "SELECT DISTINCT Model, Description FROM Warranty"
> This works great, but I would like to concatinate some other data in the
> returned records (possibly with a JOIN)
> From the same table I would like the returned records to return "Family" a
nd
> "Price".
> So the returned records would be:
> Model Description Family Price (with the Model and Description being
> Distrinct).
> NOTE: There is a Primary Key Called "ID".
> Maybe something like:
> SELECT DISCTINCT C1.Model, C1.Description FROM Warranty AS C1, Warranty AS
> C2 (Select C2.Family, C2.Price FROM C2 ON C1.ID = C2.ID)
> Any help is greatly appreciated,
> Thanks,
> Chuck
>
>
No comments:
Post a Comment