Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it L'avatar di B-Side
    Registrato dal
    Sep 2004
    Messaggi
    11

    Ordinare una colonna espressione

    salve a tutti,
    ho creato su access una query del tipo:

    codice:
    
    select 
    id, 
    importo_credito, 
    (select sum(importo) from pagamenti where id_credito=[crediti].[id]) as tot_pagamenti 
    from crediti 
    

    che restituisce un tabella tipo:

    codice:
    ----------------------------------------
    |               CREDITI                |
    ----------------------------------------
    | ID | importo_credito | tot_pagamenti |
    ----------------------------------------
    |   1|              300|            250|
    |   2|             1000|            600|
    |   3|              500|            460|
    ----------------------------------------
    il problema è:
    posso ordinare questa tabella per tot_pagamenti essendo questo un campo derivato da un'espressione?

    Grazie
    We are the damned of all the world / With saddness in our hearts / The wounded of the wars / We've been hung out to dry / You didn't want us anyway / And now we're making up our minds / You tell us how to run our lives / We run for youthanasia

  2. #2
    con il suo ordinale. quindi ... ORDER BY 3

  3. #3
    Utente di HTML.it L'avatar di B-Side
    Registrato dal
    Sep 2004
    Messaggi
    11
    o mio Dio, io mi stavo scervellando!
    funziona anche cosi? si vede che sono un novellino

    thanks
    We are the damned of all the world / With saddness in our hearts / The wounded of the wars / We've been hung out to dry / You didn't want us anyway / And now we're making up our minds / You tell us how to run our lives / We run for youthanasia

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.