Is it possible to convert my SQL Query to Laravel 4 Query
SQL:
SELECT
Branch_tbl.ID,
Branch_tbl.BranchName,
(
SELECT
SUM(Expenses.Expense)
FROM
Expenses
WHERE
Expenses.BranchID = Branch_tbl.ID
) as 'Total Expenses'
FROM
Branch_tbl
You may try raw expression (maybe it's not to best solution)
If you have a complex subquery you can separate it:
Be careful not to create any SQL injection with raw expression.