/**
  * Compile a SQL SELECT statement from a Query instance.
  *
  * @param  Query   $query
  * @return string
  */
 public function select(Query $query)
 {
     $sql = parent::components($query);
     // SQL Server does not currently implement an "OFFSET" type keyword, so we
     // actually have to generate the ANSI standard SQL for doing offset like
     // functionality. OFFSET is in SQL Server 2012, however.
     if ($query->offset > 0) {
         return $this->ansi_offset($query, $sql);
     }
     // Once all of the clauses have been compiled, we can join them all as
     // one statement. Any segments that are null or an empty string will
     // be removed from the array before imploding.
     return $this->concatenate($sql);
 }
Пример #2
0
 public function select(Query $query)
 {
     $sql = parent::components($query);
     if ($query->offset > 0) {
         return $this->ansi_offset($query, $sql);
     }
     return $this->concatenate($sql);
 }