I need to pass this select
that cost me a lot to do it, to Laravel
and there is no way, I would like to know if there is any way to put the query
direct without passing each clause by the Laravel
functions or if someone helps me pass it would be fine:)
SELECT s.class as clase,s.name as nombre,SUM(a.contador + b.contador + c.contador) as suma
FROM
(SELECT spec_id, count(spec_id) as contador
FROM wow_$region_leadder_2v2_$season
GROUP BY spec_id) a,
(SELECT spec_id, count(spec_id) as contador
FROM wow_$region_leadder_3v3_$season
GROUP BY spec_id) b,
(SELECT spec_id, count(spec_id) as contador
FROM wow_$region_leadder_rbg_$season
GROUP BY spec_id) c,
wow_specs s
WHERE a.spec_id = b.spec_id
AND a.spec_id = c.spec_id
AND a.spec_id = s.id
GROUP BY clase,nombre
ORDER by suma DESC LIMIT 1