Answer the question
In order to leave comments, you need to log in
Why does the query built in the query builder work in the console, but does not work when executed by the builder?
I have a request that looks like this:
DB::table('company_user as a')
->join('company_user as c', 'a.data', '=', 'c.data')
->where('a.company_id', '!=', 'c.company_id')
->where('a.field_name', '=', 'user_email')
->where('a.data', '!=', '')
->where('c.data', '!=', '')
->get();
select * from `company_user` as `a`
inner join `company_user` as `c`
on `a`.`data` = `c`.`data`
where `a`.`company_id` != `c`.`company_id`
and `a`.`field_name` = 'user_email'
and `a`.`data` != ''
and `c`.`data` != '';
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question