我希望有人可以提供帮助。我有使用汇总和组功能从表中查询结果。结果显示所需的正确值。当我必须在另一种情况下排队时发生了问题。
这是我的代码:
select t.nama_konsumen, t.nama_material, sum(t.netto) as Bobot, sum(t.volume), t.jenis_kendaraan, count(t.jenis_kendaraan) as kubik from t_penjualan_cash as t group by t.nama_konsumen, t.nama_material, t.jenis_kendaraan with rollup
这是结果
nama_konsumen nama_material sum(t.netto) sum(t.volume) t.jenis_kendaraan kubik
ABOK SPLIT 1X2 84398 62,5 COLT DIESEL 9
ABOK SPLIT 1X2 84398 62,5 (null) 9
ABOK SPLIT 2X3 7980 5,81 COLT DIESEL 1
ABOK SPLIT 2X3 7980 5,81 (null) 1
ABOK SPLIT 3X5 0 7,33 COLT DIESEL 1
ABOK SPLIT 3X5 0 7,33 (null) 1
ABOK SPLIT STOCK 54240 30,50 COLT DIESEL 4
ABOK SPLIT STOCK 54240 30,50 (null) 4
ABOK (null) 287704 213,36 (null) 33
我想在输出中显示的就是这样。
nama_konsumen nama_material sum(t.netto) sum(t.volume) t.jenis_kendaraan kubik
ABOK SPLIT 1X2 84398 62,5 COLT DIESEL 9
ABOK SPLIT 2X3 7980 5,81 COLT DIESEL 1
ABOK SPLIT 3X5 0 7,33 COLT DIESEL 1
ABOK SPLIT STOCK 54240 30,50 COLT DIESEL 4
ABOK (null) 287704 213,36 (null) 33
我不知道该怎么做。如果有人可以帮助我,我将非常高兴。.谢谢..