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!