Daftar dan Belajar Sekarang!

Memanggil isi subquery

foto kresnanoobs
11 Kontribusi 1 Coto
3 bulan yang lalu
gan ijin bertanya saya ada query seperti ini
SELECT COUNT(a.enquiry_from) AS valid
FROM crm AS a
JOIN
(
	select DATE(created_at) as tanggal,
	sum(case when enquiry_from=0 then 1 else 0 end) as whatsap, 
	sum(case when enquiry_from=2 then 1 else 0 end) as calling, 
	sum(case when enquiry_from=5 then 1 else 0 end) as email, 
	sum(case when enquiry_from=6 then 1 else 0 end) as book, 
	sum(case when enquiry_from=1 then 1 else 0 end) as sms, 
	SUM(case when enquiry_from=7 then 1 else 0 END) as reference
	from `crm_counts`
	GROUP BY tanggal
) AS b
ON DATE(a.created_at)=DATE(b.tanggal)
GROUP BY a.created_at
bagaimana saya menampilkan whatsap,calling, dll?

Jawaban
foto hilmanrdn
1906 Kontribusi 1449 Coto
3 bulan yang lalu
Keluarkan semua hasil query kamu die(var_dump($hasiQuery)) nanti akan terlihat strukturnya


Login untuk diksusi di forum sekolah koding