CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Column 'lime_conditions.cfieldname' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.. The SQL statement executed was: SELECT [cqid], [method], [cfieldname], [value]
FROM [lime_conditions]
WHERE qid=1532 AND scenario=1
GROUP BY [cqid], [method]
ORDER BY [cqid]

C:\etc\Apache\htdocs\MSSQL\framework\db\CDbCommand.php(528)

516             return $result;
517         }
518         catch(Exception $e)
519         {
520             if($this->_connection->enableProfiling)
521                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
522             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
523             $message = $e->getMessage();
524             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
525                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
526             if(YII_DEBUG)
527                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
528             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
529                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
530         }
531     }
532 
533     /**
534      * Builds a SQL SELECT statement from the given query specification.
535      * @param array $query the query specification in name-value pairs. The following
536      * query options are supported: {@link select}, {@link distinct}, {@link from},
537      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
538      * {@link limit}, {@link offset} and {@link union}.
539      * @return string the SQL statement
540      * @since 1.1.6

Stack Trace

#1
+
 C:\etc\Apache\htdocs\MSSQL\application\models\Conditions.php(177): CDbCommand->query()
172             if( $group != NULL )
173             {
174                 $record->group($group);
175             }
176 
177             return $record->query();
178         }
179         
180         function getConditionsQuestions($distinctrow,$deqrow,$scenariorow,$surveyprintlang)
181         {
182             $conquery="SELECT cid, cqid, q.title, q.question, value, q.type, cfieldname "
#2
+
 C:\etc\Apache\htdocs\MSSQL\application\controllers\admin\printablesurvey.php(294): Conditions->getSomeConditions(array("cqid", "method", "cfieldname", "value"), "qid=1532 AND scenario=1", array("cqid"), array("cqid", "method"))
289                         }
290 
291                         $x=0;
292 
293                         $conditions1="qid={$deqrow['qid']} AND scenario={$scenariorow['scenario']}";
294                         $distinctresult=Conditions::model()->getSomeConditions(array('cqid','method', 'cfieldname', 'value'), $conditions1, array('cqid'),array('cqid', 'method'));
295 
296                         //Loop through each condition for a particular scenario.
297                         foreach ($distinctresult->readAll() as $distinctrow)
298                         {
299                             $condition = "qid = '{$distinctrow['cqid']}' AND parent_qid = 0 AND language = '{$surveyprintlang}'";
#5
+
 C:\etc\Apache\htdocs\MSSQL\application\core\Survey_Common_Action.php(100): CAction->runWithParamsInternal(printablesurvey, ReflectionMethod, array("surveyid" => "653847", "sa" => "index", "iSurveyId" => "653847", "iSurveyID" => "653847"))
095             $oMethod = new ReflectionMethod($this, $sDefault);
096         }
097 
098         // We're all good to go, let's execute it
099         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
100         return parent::runWithParamsInternal($this, $oMethod, $params);
101     }
102 
103     /**
104     * Some functions have different parameters, which are just an alias of the
105     * usual parameters we're getting in the url. This function just populates
2013-02-13 14:44:17 Apache/2.4.3 (Win32) OpenSSL/0.9.8x PHP/5.4.8 Yii Framework/1.1.10