View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - select distinct - ProjeQtOr
 
 

select distinct

More
28 Nov 2014 15:52 #1 by LU611
select distinct was created by LU611
Hy,

I need to a private report to extract a list of table records 'work' for a given week.
I use the following script:

$where='idProject in '. $projectList;
$where.=' and idResource = '. $user->id;
$where.=' and week = '. $periodValue;
$work = new Work();
$workList = $work->getSqlElementsFromCriteria(null, false, $where);
foreach ($workList as $work) { ...

The result is a list containing one row per day, like this sql command :

select * from work where idProject = ............

But my need is :

select distinct (field 1, filed 2, .. ) from work where idProject = ......

How can I do ?

Thanks in advance.

Armel
The topic has been locked.
More
28 Nov 2014 16:17 #2 by babynus
Replied by babynus on topic select distinct
What you need is a "group by" query.
ProjeQtOr persistence framework does not take these queries into account.
You have to build it by your own and use the Sql::query() to execute it.

Babynus
Administrator of ProjeQtOr web site
The following user(s) said Thank You: LU611
The topic has been locked.
More
28 Nov 2014 18:25 #3 by LU611
Replied by LU611 on topic select distinct
Thanks,

I've find an other issu : i just transform my "$workList" with php function array_unique .

It's running.

You can close the topics.
The topic has been locked.
Moderators: babynusprotion
Time to create page: 0.031 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.