[ic] sql funtion (group by and count)
Xavier GILLET
interchange-users@icdevgroup.org
Tue May 6 16:54:00 2003
> On Tue, 6 May 2003 22:08:48 +0200
> "Xavier GILLET" <xavier.gillet.perso@wanadoo.fr> wrote:
>
> > hi,
> >
> > Does anyone know how to use group by and count mysql functions in IC ?
> > This request groups column 'departement' and display the list, but
> > does not count the number of entries for each 'departement'.
> >
> > [query sql="select departement, count(departement) from [scratch
> > this_page]
> > where
> > initial_status = 'confirmee'
> > and
> > actual_status = 'En ligne'
> > and
> > sens = 'Vente'
> > group by departement"
> > type=list]
> > [list]
> > [sql-param departement]<br>
> > [/list]
> > [/query]
>
> The [query] tag groks any valid SQL statement if the underlying database
> is native SQL, but you might need to use [sql-pos] resp. [PREFIX-pos]
> to learn the results of it. In your example [sql-pos 1] would display
> the count.
>
> Bye
> Racke
Perfect !
Thanks a lot.
Xavier.
>
> --
> LinuXia Systems => http://www.linuxia.de/
> Expert Interchange Consulting and System Administration
> ICDEVGROUP => http://www.icdevgroup.org/
> Interchange Development Team
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>