P
P
Peyoter2017-06-01 15:25:44
MySQL
Peyoter, 2017-06-01 15:25:44

How to write a request for the minimum price of child elements?

Given:
There is a table with houses. = houses
id, name
There is a table with flats = flats
id, house_id, price
You need to create two queries for the filter:
1. Filter houses by the price of apartments in ascending/descending order.
2. Find all the houses where the price of apartments starts from "from" or "to".
Ideal to understand how to do it on Eloquent if using Laravel

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pantagruel964, 2017-06-01
@pantagruel964

https://laracasts.com/series/eloquent-techniques/e...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question