Can you post your code? Can't really see how you are building the query or what you are trying to accomplish. You don't need the DB::. Try just ->raw. Or you can use the standard ->select('blurb') and use your as in there.
Why does each table need an alias? Old db? Can you not just rename your tables? Or are you trying to make it work better with your Models?
You will probably be better off in this case using raw on its own and not trying to chain with Eloquent.
DB::table('table')->raw('full query here')->get()
It will be a little more expressive and easier to understand in the future.
This is the solution
$results = DB::select('select * COMPLICATED QUERY = ?');
http://laravel.io/forum/02-27-2014-how-would-one-run-a-select-on-a-subquery-using-fluent?page=1
Thank you T2theC.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community