K
K
kedrovdanil2020-08-02 19:56:08
Laravel
kedrovdanil, 2020-08-02 19:56:08

Is it possible to sort a selection of 2 tables in Laravel?

Is it possible to somehow select from 2 database tables using left join, and then sort with a condition on the results of the selection in Laravel?

If you use SQL, then the selection works and looks like this:

select email from (select * from employee left join bicycle on bicycle.id = employee.bicycle_id where bicycle_id is not null) as foo where gender = 'Female';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2020-08-02
@kedrovdanil

rewrite the request on the builder -> get the collection -> sausage as needed.
or raw request and processing. but this is already, although possible, but not laravel-way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question