View Single Post
  #1 (permalink)  
Old 03-05-2007, 03:55 AM
Tommy1402 Tommy1402 is offline
Junior Member
 
Join Date: Feb 2007
Posts: 26
Default Zend_Db_table , DISTINCT

Hi,
How to make a DISTINCT selection from a table?
from table below, I select all data from table ITEM, in table item, there are some records which have same name.

PHP Code:
$myItem = new Item();
$view->item $myItem->fetchAll(); 
can I use something like:
PHP Code:
$view->item $myItem->fetchAll('DISTINCT'); 
?

I can use DISTINCT mode when I use the DB object instead of Table object, like:

PHP Code:
$sql "SELECT `itemid` DISTINCT FROM `item`";
$view->item $db->query($sql); 
But, if I use the DB object, what's the point in creating model of table ITEM ?

Thanks!
Reply With Quote