[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [SQL] group by hjælp



I sslug.programmering, skrev Niels Muller Larsen:
>  Følgende eksperiment er lavet i MySQL
> 
>  mysql> select * from t2;
>  +----+-----------------+-----------+------+
> | id | bogtitel        | salgssted | pris |
>  +----+-----------------+-----------+------+
> |  1 | Linux A-Z       | Amazon    |  200 |
> |  2 | Linux A-Z       | Metro     |  180 |
> |  3 | Mit liv som Tux | Bogladen  |   99 |
> |  4 | Mit liv som Tux | Amazon    |  199 |
> |  5 | N               | Metro     |   50 |
>  +----+-----------------+-----------+------+
>  5 rows in set (0.00 sec)
> 
>  Dette passer til dit oplæg.
> 
>  Prøv nu:
>  mysql> select id,bogtitel,salgssted,min(pris) from t2 group by bogtitel;
>  +----+-----------------+-----------+-----------+
> | id | bogtitel        | salgssted | min(pris) |
>  +----+-----------------+-----------+-----------+
> |  1 | Linux A-Z       | Amazon    |       180 |
> |  3 | Mit liv som Tux | Bogladen  |        99 |
> |  5 | N               | Metro     |        50 |
>  +----+-----------------+-----------+-----------+
>  3 rows in set (0.00 sec)
> 
>  Sådan læste jeg dit spørgsmål.

Hvilket absolut er en bug i mysql.. 

Der findes ingen record i den oprindelige tabel der har id 1 og pris
180. Mysql returnerer data der ikke eksisterer. 


Jesper

-- 
./Jesper Krogh, sslug@sslug, Jabber ID: sslug@sslug



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-07-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *