Re: Coloana calculata intr-un "select"

Petru Rațiu <[email protected]>
Newsgroups gmane.org.user-groups.rlug.offtopic
Message-ID <CAFNpagORbbn0piw3H8SVBf0Mo7a=BZenGuzFrz8ak-nzm7yQ2g@mail.gmail.com>
Nu stiu daca am inteles exact ce vrei, da' "SELECT SUM( (c1+c2+c3)*140.15)
) AS Pret FROM table ;" ce-are?

2017-09-22 16:54 GMT+03:00 Dragos Popescu <[email protected]>:

> Salutare.
> Să pp că am un tabel în sqlite, cu coloanele c1, c2, c3.
>
> La un moment dat vreau să fac un select care să-mi dea suma valorilor din
> coloanele tabelului.
> "select sum(c1)+sum(c2)+sum(c3) as Total from tabel" e ok, returnează ce-mi
> trebuie.
>
> Ei, aşa avea nevoie de încă o coloană, să-i zicem "Preţ", care sa fie
> "Total"*140.15, de ex.
> Cum se face asta într-un singur select, dacă se poate face?
>
> --
> Dragos P
> 126296 luser
> "La revedere. Drum bun"
> _______________________________________________
> Offtopic mailing list
> [email protected]
> http://lists.lug.ro/mailman/listinfo/offtopic
>
_______________________________________________
Offtopic mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/offtopic
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.