Skip site navigation (1) Skip section navigation (2)

Re: Tableau dans une requête

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: pgsql-fr-generale(at)postgresql(dot)org
Subject: Re: Tableau dans une requête
Date: 2009-09-13 21:59:06
Message-ID: 575f350a-917e-458c-be17-4685b5bbd854@mm (view raw or flat)
Thread:
Lists: pgsql-fr-generale
	Samuel ROZE wrote:

>    EXECUTE 'SELECT id_couple_critere , count(*)
>        FROM graphiques.critere
>        WHERE lib_critere = ANY ''$1''
>        GROUP BY id_couple_critere
>        HAVING count(*) = $2' INTO v_id_couple USING v_criteres_str,
> array_upper(v_criteres, 1);

Pourquoi utiliser EXECUTE ou autrement dit en quoi la version ci-dessous ne
conviendrait pas?

SELECT id_couple_critere , count(*)
       FROM graphiques.critere
       WHERE lib_critere = ANY (v_criteres)
       GROUP BY id_couple_critere
       HAVING count(*) = array_upper(v_criteres, 1);

-- 
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

In response to

pgsql-fr-generale by date

Next:From: Daniel VeriteDate: 2009-09-13 22:09:35
Subject: Re: Noms de variable dynamiques
Previous:From: Dimitri FontaineDate: 2009-09-13 21:27:49
Subject: Re: Noms de variable dynamiques

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group