Je souhaite poser des questions sur SQL Server 2005 concernant le regroupement de dates avec d'autres champs de somme.Groupe de dates SQL
| tanggal | nama | qty |
|---------------------|-------------------------|------|
| 2017-07-11 06:25:00 | APEL | 4.00 |
| 2017-07-11 06:25:00 | SUSU KENTAL MANIS PUTIH | 4.00 |
| 2017-07-11 06:29:00 | APEL | 4.00 |
| 2017-07-11 06:29:00 | SUSU KENTAL MANIS PUTIH | 4.00 |
| 2017-07-10 06:29:00 | APEL | 2.00 |
| 2017-07-10 06:29:00 | SUSU KENTAL MANIS PUTIH | 2.00 |
| 2017-07-11 00:00:00 | APEL | 1.00 |
| 2017-07-11 00:00:00 | SUSU KENTAL MANIS PUTIH | 1.00 |
et je dois le résultat comme celui-ci
| Tanggal | Barang | Jumlah |
|------------|-------------------------|--------|
| 2017-07-10 | APEL | 2.00 |
| 2017-07-10 | SUSU KENTAL MANIS PUTIH | 2.00 |
| 2017-07-11 | APEL | 9.00 |
| 2017-07-11 | SUSU KENTAL MANIS PUTIH | 9.00 |
Voici le code
select j.tanggal [Tanggal],p.nama [Barang],sum(p.qty) [Jumlah]
from proses p
left join jual j on j.kode=p.kode
group by j.tanggal,p.kodeItem,p.nama,p.unit,p.kode
thx pour la réponse, mais son groupe avait besoin de somme cuz (p.qty) – Davis