Re: Limit query output to a single record based on combination of fields
From: Urs Metzger <urs_at_ursmetzger.de>
Date: Mon, 12 May 2008 16:55:12 +0200
Message-ID: <g09lne$lmp$1@online.de>
Date: Mon, 12 May 2008 16:55:12 +0200
Message-ID: <g09lne$lmp$1@online.de>
Sashi schrieb:
> Hi all,
>
> I have a query as follows:
>
> Select building, floor from T1
>
> I would like to limit the output where the building, floor combination
> is present only once in the output.
>
> For example, if the output is
>
> blgdA, 2
> bldgA, 3
> bldgA, 3
> bldgB, 1
> bldgB, 2
> bldgB, 2
>
> I would like to filter it so that the output is only
> blgdA, 2
> bldgB, 1
>
> I'm not sure about how to do this.
>
> Can someone help out?
> Thanks,
> Sashi
Search the docs for GROUP BY and HAVING.
htht,
Urs Metzger
Received on Mon May 12 2008 - 09:55:12 CDT