@Snapey Good to know mate. Never used it myself :)
@ChrisPercival your SQL looks so wonky to me and I never seen anything like it and I work with SQL every day. Give us some data and what you expect to get out of the query.
SELECT * FROM orders WHERE 111 BETWEEN column_1 AND column_2;
only works if column_1 is the lower bound and column_2 is the upper bound. It does not work if the values are reversed meaning that it does not actually seem to check if the number is BETWEEN, its actually checking if value is more than the first clause and less than the second.
The query in your very first post would have worked if column_1 was the upper number and column_2 the lower, but without values or a hint what column_1 and column_2 actually were then we could not get to the right answer straight away.
This is why I always prefer real code than abstracted answers
For instance if the query was
function aliveIn($year)
{
return People::where('birthdate','>=',$year)->where('died','<=',$year)->get();
}
then the intent of the code would have been clearer