aika Posted January 25, 2010 Report Share Posted January 25, 2010 (edited) ir tabula ar notikumiem +1 datums1 +8 datums1 -2 datums1 -3 datums1 -1 datums2 utt nepieciešams izveidot pieprasījumu, kas atgrieztu rezultātu, sagrupētu pa datumiem un sasummētiem notikumiem pēc moduļiem: +9 -5 datums1 -1 datums2 jūtu ka atbilde ir kautkur tepat līdzās, bet ... atbildēm paldies jau iepriekš! Edited January 25, 2010 by aika Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted January 25, 2010 Report Share Posted January 25, 2010 Man slinkums pārbaudīt, bet varētu būt kaut kā tā - SELECT SUM(if(vertiba>0,vertiba,0)) As plus, SUM(if(vertiba<0,vertiba,0)) as minus, datums ... group by datums Quote Link to comment Share on other sites More sharing options...
aika Posted January 25, 2010 Author Report Share Posted January 25, 2010 pareizi, tas ka selektā ifus var likt, man bija piemirsies! txs Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.