[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



On Sat, 2 Jun 2007 18:57:22 +0000 (UTC)
Jesper Krogh <sslug@sslug> wrote:

> Hvilket absolut er en bug i mysql.. 

vrøvl!! MIN er en aggregate function og returnerer resultatet af
funktionen kørt over en gruppe (i dette tilfælde hver
grupperingen efter navn). bemærk at det IKKE er pris den returnerer men
MIN(pris) - hvilket kolonne navnet også fint viser.
 
> Der findes ingen record i den oprindelige tabel der har id 1 og pris
> 180. Mysql returnerer data der ikke eksisterer. 

hvad med :
select id, navn, min(pris) from tabel 
Der vil du få samme min(pris) ud for alle rækker fordi den finder MIN
på tværs af gruppen (her alle rækker i "tabel")




-- 
    Kim Schulz       | Blog: http://www.schulz.dk/
Email: sslug@sslug | Work: http://www.devteam.dk/
Phone: +45 5190 4262 | Fun : http://www.chilifan.dk/


 
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] *