2009年7月30日星期四

RE: [fw-db] DISTINCT SQL Statement

Hi,

 

In case you don’t need to build your query dynamically (for. ex. for pagination) you can write SQL manually inside your model.

 

So within model class:

 

 

public function getCinCount()

{

 

--  your code ---

 

$this->_db->runQuery(“SELECT COUNT(DISTINCT(CIN_Number)) as NumberofCases, MMT_Number as NumberOfCase  FROM material”);

 

--  your code ---

 

return $result;

}

 

 

 

 

 

From: Erdal YAZICIOGLU [mailto:erdal.yazicioglu@gmail.com]
Sent: Thursday, July 30, 2009 4:49 PM
To: fw-db@lists.zend.com
Subj
ect: [fw-db] DISTINCT SQL Statement

 

Hello all

How can I run this query? I have been struggeling for hours.

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

Thanks a lot



Erdal YAZICIOGLU
System & Network Engineer
Page Europa S.R.L - General Dynamics
www.pageuropa.it
Office - Rome : +39 0650395292
Mobile -Rome : +39 3490787196
Mobile -Istanbul: +90 536 3447989

没有评论: