add distinct in select

hi all

i am trying to query a select distinct . The code i wrote is




  $stud= Yii::app()->db->createCommand(array(

     			 'select Distinct' => 'stud_number',

 				   'from' => 'tbl_student',

				               ))->queryColumn();



please help me

Did you try to remove the space between select and Distinct? API reference (see also constructor documentation). Perhaps even ‘distinct’=>true has to be added?

/Tommy

Thank you tri

this is working





 $stud= Yii::app()->db->createCommand(array(

                         'select' => 'stud_number',

                           'distinct' => 'true',

                                   'from' => 'tbl_student',

                                               ))->queryColumn();