Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | id | artikel | einzelpreis | gesamtpreis | name | intervall | anzahl | domain | start | bezahltbis
- | 1 | ABC123 | 5 | 20 | VPS | 12 | 4 | example.de | 2000-01-01 | 2008-12-31
- | 2 | ABC456 | 15 | 30 | Web-Paket A | 1 | 2 | example.com | 2000-01-01 | 2008-12-31
- | 3 | ABC789 | 2 | 10 | Spamschutz | 12 | 5 | example.de | 2000-01-01 | 2008-12-31
- | 1 | ABC123 | 5 | 20 | VPS | 12 | 4 | example.de | 2000-01-01 | 2009-12-31
- | 2 | ABC456 | 15 | 30 | Web-Paket A | 1 | 2 | example.com | 2000-01-01 | 2009-12-31
- | 3 | ABC789 | 2 | 10 | Spamschutz | 12 | 5 | example.de | 2000-01-01 | 2009-12-31
- | 1 | ABC123 | 5 | 20 | VPS | 12 | 4 | example.de | 2000-01-01 | 2010-12-31
- | 2 | ABC456 | 15 | 30 | Web-Paket A | 1 | 2 | example.com | 2000-01-01 | 2010-12-31
- | 3 | ABC789 | 2 | 10 | Spamschutz | 12 | 5 | example.de | 2000-01-01 | 2010-12-31
- resultat soll sein:
- | id | artikel | einzelpreis SUM() | gesamtpreis SUM()| name | intervall | anzahl | domain | start | bezahltbis
- | 1 | ABC123 | 15 | 60 | VPS | 12 | 4 | example.de | 2000-01-01 | 2010-12-31
- | 2 | ABC456 | 45 | 90 | Web-Paket A | 1 | 2 | example.com | 2000-01-01 | 2010-12-31
- | 3 | ABC789 | 10 | 120 | Spamschutz | 12 | 5 | example.de | 2000-01-01 | 2010-12-31
- bisher bekomme ich mit:
- SELECT name, SUM(gesamtpreis) as gesamt,SUM(einzelpreis) as einzelpreis FROM bill GROUP BY name
- | einzelpreis SUM() | gesamtpreis SUM()| name |
- | 15 | 60 | VPS |
- | 45 | 90 | Web-Paket A |
- | 10 | 120 | Spamschutz |
Add Comment
Please, Sign In to add comment