文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>zend distinct

zend distinct

时间:2011-05-31  来源:长城的草

/*
10.4.3.10. 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
*/

<?php

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


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

?>

/*
10.4.3.11. 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() 
->from('material',
array(
'NumberOfCases' => new Zend_Db_Expr('COUNT(DISTINCT CIN_Number)'),
'MMT_Number'
))
->group('MMT_Number');



相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载