I have a table
AvailbilityDate | Resort | AccomName | Price | Min Occupancy
24 June 2012 | Resort1 | Accom1 | 999 | 8
24 June 2012 | Resort1 | Accom2 | 888 | 6
24 June 2012 | Resort2 | Accom1a | 243 | 10
24 June 2012 | Resort2 | Accom2a | 563 | 7
What I currently have is
SELECT AvailbilityDate, Resort, MIN(Price) AS Lowest
FROM mytable
GROUP BY AvailbilityDate, Resort
I want to be able to get the AccomName and the Min Occupancy
Many thanks in advance
With standard ANSI SQL, the solution would be this:
Should work on PostgreSQL, Oracle, DB2, SQL Server, Sybase and Terradata