Hi guys .. i have a trouble i want to select count(id) FROM 5 tables and choose the quicker way...
I tried something like
(SELECT (COUNT(id)) AS likes FROM status_likes WHERE nick='Trki') as likes_count,
(SELECT (COUNT(id)) AS comments FROM comments WHERE nick='Trki') as comments_count,
(SELECT (COUNT(id)) AS statuses FROM statuses WHERE nick='Trki') as statuses_count
which works good but isn't it as slow as i would make 5mysql queries separetly with SELECT ?
OR is there some better way? :P
+++ ANOTHER PROBLEM
This query SELECT DISTINCT shared_from_id FROM statuses WHERE shared_from_id<>0 returns this:
What is good.. and why then i cant use the all query like this ? :( :
SELECT nick FROM statuses WHERE id IN (SELECT DISTINCT shared_from_id FROM statuses WHERE shared_from_id<>0)
The program died or show the result with duration more then 31s :/
:( IF someone would help i would be glad :)