Hello.

On Tue, Jun 19, 2001 at 11:30:34AM +0530, [EMAIL PROTECTED] wrote:
[...]
> This is my sql statement:
> mysql> select count(*),travel.nome_hotel,travel.tour_operator,
> city.city,travel.vitofferta from travel,city where city.id=travel.cityid
> group by travel.nome_hotel limit 5;
> 
> The result:
> +----------+-------------------+----------------+---------------+------------+
> | count(*) | nome_hotel        | tour_operator  | city          | vitofferta |
> +----------+-------------------+----------------+---------------+------------+
> |        2 | Abi d'Oru         | HELVETIC TOURS | Sardegna Nord | 1995       |
> |        2 | Abou Nawas Djerba | HELVETIC TOURS | Jerba         | 899        |
> |        9 | Adams Beach       | HELVETIC TOURS | Cipro         | 1095       |
> |        1 | Aegean Village    | HELVETIC TOURS | Cos           | 1099       |
> |        2 | Aeneas            | HELVETIC TOURS | Cipro         | 1211       |
> +----------+-------------------+----------------+---------------+------------+
> 
> Perfect!  But it the price the last inserted price??  I am not sure.  Here
> I remove the periodo field as it wraps.
> 
> Can you tell me how to do this to create the hotel table?

There is no nice one-query solution to this problem with MySQL, but
only a (speed-inefficient) hack. See the tutorial in the manual for
more details:

http://www.mysql.com/doc/e/x/example-Maximum-column-group-row.html

Bye,

        Benjamin.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to