Mysql LEFT JOIN table filter original table properly

So i have following tables. As you can see it all works amazing.

http://sqlfiddle.com/#!9/e19e5/1

My issue is that i’d like to be able to filter by user_id on the punch_clock table.

When i add AND user_id = 3; to the end of the sql statement it doesn’t show the empty results..

What is the best way to achieve this?

Thanks


Source: php

Leave a Reply