Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 laravel 并试图弄清楚如何用 fluent / eloquent (laravel) 运行这个查询
select email, SUBSTRING_INDEX(email,'@',-1) AS domain from epost order by domain desc;
我的目标是通过域 namn 进行排序,而不仅仅是从字符串的开头进行排序。
return Email::order_by('email', 'desc');
请帮忙。
我现在使用这个字符串让它工作
return Epost::orderby(\DB::raw("SUBSTRING_INDEX(email,'@',-1)"), "desc")->get();