php - How to retrieve data from database using JOIN?Get the solution ↓↓↓
I wanted to retrieve data from database but my code seems have a problem. I googled the solution but i'm not really understand. Could you help me fix it?
This is my code:
SELECT kod_jawatan.jawatan_nama as jawatan, MONTHNAME(mohon_tarikh) AS mname, count(jawatan_id) AS total FROM tpermohonan JOIN kod_jawatan ON tpermohonan.mohon_id = kod_jawatan.jawatan_id WHERE year(mohon_tarikh) = '2019' GROUP BY MONTH(mohon_tarikh) UNION ALL SELECT 'Total', count(jawatan_id) AS total FROM kod_jawatan WHERE year(mohon_tarikh) = '2019'
My table structure as shown below.
This is what I want as my output:
People are also looking for solutions of the problem: script cache:clear returned with error code 255
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.