Memanggil isi subquery

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?

avatar kresnanoobs
@kresnanoobs

16 Kontribusi 1 Poin

Diperbarui 5 tahun yang lalu

1 Jawaban:

Keluarkan semua hasil query kamu die(var_dump($hasiQuery)) nanti akan terlihat strukturnya

avatar hilmanski
@hilmanski

2686 Kontribusi 2135 Poin

Dipost 5 tahun yang lalu

Login untuk ikut Jawaban