1

I'm trying to find a way convert it to query builder in laravel but I still can't do it!!

SELECT * FROM (
  SELECT thanhvientrong.manguoidung, detai.ngaykt, COUNT(*)
    AS c FROM detai
    INNER JOIN thanhvientrong ON detai.madt = thanhvientrong.madt AND detai.id_cap = 5
    GROUP BY thanhvientrong.manguoidung HAVING c > 0
  )
  AS dem where DATE(ngaykt) BETWEEN '2019-09-14' AND '2020-09-15'

1 Answer 1

0

Firstly, I'm not really catch what you mean. But, i think these solutions will help you:

I think relationship will be the best solution for your issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.