hy I'm new to Laravel 4.2 And I have Sub Query Sql Like this
Select *, Count(*) as total_rows From(
SELECT test_id,
SUM(IF(app.status='complete',apt.result,0)) AS complete_sum,
SUM(IF(app.status='process',apt.result,0)) AS process_sum
FROM application_test AS apt
JOIN application AS app ON app.id=apt.application_id
GROUP BY apt.test_id)
my quetion is how I can write this sub query sql on laravel 4.2