Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Select distinct value

$
0
0
Hi,

I am trying to select distinct value from a table.

$models=Product::model()->findAll(array(
    'select'=>'t.Category',
    'distinct'=>true,
));


Using the above, I get an array of Active Record. What I want is an array of distinct product category. I am aware that I need to do a loop through and build array myself.

Is there a way to just get an array of distinct product category ?

Thank you

Viewing all articles
Browse latest Browse all 18717


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>