[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] PostgreSQL og rang udregning



On Fri, 09 Jun 2006 23:06:13 +0200, Jesper K. Pedersen wrote:
> Det er let at rangere spillere med en simpel select ... order by score 
> limit 40

Pas på med LIMIT. Hvad så hvis der er flere folk med samme score, inden
for top-40?

Overvej et kig på
http://troels.arvin.dk/db/rdbms/#select-top-n-postgresql

> Jeg kan bare ikke helt gennemskue muligheden for direkte i SQL at bruge
> denne "orden" til at hente data fra en point tabel.

Du burde kunne ordne det med et sub-query eller to. Eller to kan skabe et
"orden"-view og join'e på det. I det hele taget kan jeg anbefale at bryde
SQL-udfordringer ned i dele vha. views.

-- 
Greetings from Troels Arvin



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-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] *