Ребята, привет
помогите объединить запросы:
$Query_1 = Loan::query()
->select('loans.user_id')
->selectRaw('sum(loans.amount_usd) as llRequest')
->where('loans.status_id',1)
->from('loans')
->groupBy('loans.user_id');
$Query_2 = Loan::query()
->select('loans.user_id')
->selectRaw('sum(loans.amount_usd) as llInWork')
->where('loans.status_id',1)
->from('loans')
->groupBy('loans.user_id');
надо объединить $Query_1 и $Query_2 по 'loans.user_id' столбцу чтоб получить массив вида:
user_id | llRequest | llInWork
guys,
is it possible to do the next query in eloquent:
SELECT
FROM(
(Select Count() as StockCountA from Table_A where dept='AAA') StockCountA ,
(Select Count(*) as StockCountB from Table_B where dept='BBB') StockCountB
);
i want to combine result of two query in one raw.
tried a lot of variants. Would be appreciate for any ideas.
Unable to connect to host 127.0.0.1, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL said: Protocol mismatch; server version = 11, client version = 10