Support the ongoing development of Laravel.io →

Muhammed

Joined 19 Jun 2020

Statistics

Threads 1
Replies 4
Solutions 1
Articles 0
posted 4 years ago

what is the best way to write this type of queries?

SELECT user_id, COUNT(*) AS clients_commented_for FROM (SELECT user_id, COUNT(*) FROM comments WHE...

0 Likes
10 Replies
Solved
replied 4 years ago

what is the best way to write this type of queries?

I used fromSub method, I think it's the best way

uteqnl liked this reply

1 Likes
Solved
replied 4 years ago

what is the best way to write this type of queries?

SELECT id, name, (SELECT COUNT(*) FROM commentsWHEREusers.id=comments.user_idANDcreated_at>= '2...

0 Likes
replied 4 years ago

what is the best way to write this type of queries?

Error Code: 1242. Subquery returns more than 1 row

0 Likes
replied 4 years ago

why can Not seed users table???

try > composer dumpautoload

0 Likes

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.