[ic] sql funtion (group by and count)

Xavier GILLET interchange-users@icdevgroup.org
Tue May 6 16:09:01 2003


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]