title: Using the raw expression Laravel 4
body: <p>please tell me how to do this off correct query</p>
  
  <pre><code>select @a:=POW(max(count_votes), 1/10) from users;
  
  select id,name,raiting, count_votes, ((LOG(@a,count_votes))+raiting)/2 as actual_raiting from users order by actual_raiting desc ;
  </code></pre>
  
  <p>tried like this</p>
  
  <pre><code>$rating = DB::statement('select @a:=POW(max(count_votes), 1/10) from users;
  
  select id,name,raiting, count_votes, ((LOG(@a,count_votes))+raiting)/2 as actual_raiting from users order by actual_raiting desc; ');
  
  return $rating;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$rating = DB::table('users')
                      -&gt;select(DB::raw('*, @a:=POW(max(count_votes), 1/10) '))
                      -&gt;select(DB::raw('*,raiting, count_votes, ((LOG(@a,count_votes))+raiting)/2 as actual_raiting'))
                      -&gt;orderBy("actual_raiting")
                      -&gt;get();
  
      return $rating;
  </code></pre>
  
  <p>what am I doing wrong ?</p>
  
  <p>ps:/sorry for my english</p>