0

I have multiple table like this Multiple Table

And I follow this trick, but still doesn't work with my goal. Is that posible to display (Select) the 'tbl_konsepLayanan' and count the 'tbl_ulasan' + 'tbl_layanan'? How posible?

This is my query so far

SELECT tbl_konsepLayanan.*,
   COUNT(*) AS tot_ulasan,
   (SELECT COUNT(*) FROM tbl_layanan WHERE tbl_layanan.id_konsep = tbl_konsepLayanan.id_konsep) AS tot_layanan
FROM tbl_ulasan JOIN tbl_layanan ON tbl_ulasan.id_layanan = tbl_layanan.id_layanan
JOIN tbl_konsepLayanan ON tbl_konsepLayanan.id_konsep = tbl_layanan.id_konsep
GROUP BY tbl_layanan.id_konsep

The problem is if the service (tbl_layanan) not in review/zero review (tbl_ulasan) it won't display. My goal is it doesn't matter if the service did the review or not still be display in concept (tbl_konsepLayanan). Sorry for bad grammar, let the picture say

The concept has 3 values

Just display 2 values

Sorry for can't display images because my reputation

M. Abdur
  • 3
  • 3
  • Please include all of your information for a question in the question rather than links to outside websites. That way, in the future if someone ends up on this page while trying to fix a similar problem there's no worry that some of the information is no longer available. http://stackoverflow.com/help/how-to-ask – Tom H Dec 09 '17 at 22:03
  • Provide sample data and desired results. – Gordon Linoff Dec 09 '17 at 22:09
  • @TomH and GordonLinoff I had include all of my information that necessary, the link to outside is just a picture can't display in post because my reputation below 10 rep – M. Abdur Dec 10 '17 at 05:45

1 Answers1

0

try to change join with right join on

tbl_ulasan JOIN tbl_layanan

Goe Roe Ku
  • 14
  • 1
  • 3