Visualizzazione dei risultati da 1 a 4 su 4

Discussione: order by somma

  1. #1

    order by somma

    ragazzi aiutatemi a scrivere la forma esatta di questa query:

    Codice PHP:
    SELECT FROM tabella order by 'campo1+campo2+campo3 
    come si fa?

    thx
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  2. #2
    Utente di HTML.it L'avatar di nicola75ss
    Registrato dal
    Nov 2004
    Messaggi
    12,922
    codice:
    SELECT *,campo1+campo2+campo3 as tot 
    FROM tabella 
    order by tot desc

  3. #3
    mitico!

    approfitto della tua e della vostra pasienza per fare un altro paio di domandine senza aprire un ulteriore topic.

    La prima è

    se volessi fare la stessa cosa ma

    Campo1 è di una tabella, campo2 di un'altra e campo3 di un'altra ancora?
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  4. #4
    Utente di HTML.it L'avatar di nicola75ss
    Registrato dal
    Nov 2004
    Messaggi
    12,922
    codice:
    select tab1.valore+tab2.valore+tab3.valore as tot
    from tabella1 as tab1
    inner join tabella2 as tab2 on tab1.id = tab2.id
    inner join tabella3 as tab3 on tab2.id = tab3.id
    order by tot

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.