Welcome to Sign in | Help

Autoincrement Field

  •  03-11-2009, 11:51 AM

    Autoincrement Field

    Salut,

    Am o intrebare legata de un cimp autoincrement care sa se reseteze in functie de o alta valoare:

    select nr_comanda, produs, pozitie_comanda, sum(cantitate), client from
    comenzi left join clienti
                 left join produse
    group by nr_comanda, produs, pozitie_comanda, client
    order by comanda

    ma inteereseaza ca la fiecare comanda sa pot numara produsele aferente ei. ex:
    nrcomanda      produs       pozitie_comanda       client
        1                   apa                      1                  gigi
        1                 telefon                    2                  gigi
        1                   ciment                  3                  gigi
        2                     apa                    1                   fane
        2                     vodca                 2                   fane
        2                     cola                   3                     fane
        2                     pepsi                 4                       fane
View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems