Fonctions | |
| PivotTableSQL (&$db, $tables, $rowfields, $colfield, $where=false, $aggfield=false, $sumlabel='Sum ', $aggfn='SUM', $showcount=true) | |
Variables | |
| print< pre > | $sql |
| $rs = $gDB->Execute($sql) | |
| $sql | |
| print< pre > | $sql |
| $rs = $gDB->Execute($sql) | |
| PivotTableSQL | ( | &$ | db, | |
| $ | tables, | |||
| $ | rowfields, | |||
| $ | colfield, | |||
| $ | where = false, |
|||
| $ | aggfield = false, |
|||
| $ | sumlabel = 'Sum ', |
|||
| $ | aggfn = 'SUM', |
|||
| $ | showcount = true | |||
| ) |
| $rs = $gDB->Execute($sql) |
| $rs = $gDB->Execute($sql) |
| print<pre> $sql |
| $sql |
Valeur initiale :
PivotTableSQL( $gDB, # adodb connection 'products p ,categories c ,suppliers s', # tables 'CompanyName,QuantityPerUnit', # row fields # column ranges array( ' 0 ' => 'UnitsInStock <= 0', "1 to 5" => '0 < UnitsInStock and UnitsInStock <= 5', "6 to 10" => '5 < UnitsInStock and UnitsInStock <= 10', "11 to 15" => '10 < UnitsInStock and UnitsInStock <= 15', "16+" =>'15 < UnitsInStock' ), ' p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID', # joins/where 'UnitsInStock', # sum this field 'Sum' # sum label prefix )
| print<pre> $sql |
1.5.3