如何查询
SELECT * FROM your_table
WHERE FIND_IN_SET('2017-03-08',comma_date );
?
答案 0 :(得分:2)
$result = DB::table('client_invoice as a')
->leftjoin('document as b', 'a.client_invoice_id', '=', 'b.relation_id_invoice')
->whereNotNull('a.client_invoice_id')
->where('b.type_document', '=', 'client_invoice')
->distinct()
->count();
答案 1 :(得分:1)
Laravel离开了加入:
$users = DB::table('users')
->leftJoin('posts', 'users.id', '=', 'posts.user_id')
->get();
或者您可以使用Raw Expression,例如:
$users = DB::table('users')
->select(DB::raw('count(*) as user_count, status'))
->where('status', '<>', 1)
->groupBy('status')
->get();