zend distinct

首页 | 新闻 | 交流 | 问吧 | 文档 | 手册 | 下载 | 博客

zend distinct

作者:  时间: 2011-05-31

/* Adding the DISTINCT Query Modifier

The distinct() method enables you to add the DISTINCT keyword to your SQL query.

Example 10.63. Example of the distinct() method


// Build this query:
// SELECT DISTINCT p."product_name"
// FROM "products" AS p

$select = $db->select()
->from(array('p' => 'products'), 'product_name');


/* Adding the FOR UPDATE Query Modifier

The forUpdate() method enables you to add the FOR UPDATE modifier to your SQL query

2:SELECT COUNT(DISTINCT(CIN_Number)) as NumberofCases, MMT_Number as NumberOfCase  FROM material

$select = $db->select()
'NumberOfCases' => new Zend_Db_Expr('COUNT(DISTINCT CIN_Number)'),