Assuming I've understood the question, this works for me:
SELECT c.name,
COALESCE(balance,00.0)
FROM customer c LEFT OUTER JOIN
(
SELECT i.id custId,
SUM(i.value) balance
FROM invoice i
GROUP BY custId
)
ON c.id=custId;
Results, wh
- Original Message -
From: "Detlef Groth" <[EMAIL PROTECTED]>
> After consulting the php-sources I could hack the tclsqlite.c file
> myself to add aggregation capabilities to tcl, this should go into the
> next release:
This looks good. I'm surprised it didn't exist already.
> proc Med
Hello,
After consulting the php-sources I could hack the tclsqlite.c file
myself to add aggregation capabilities to tcl, this should go into the
next release:
the diff:
2c2
< ** 2001 September 15
---
> ** 2004 June 8 added aggregate function by Dr. Detlef Groth (dgroth at gmx.de)
43a44,54
> /*
Thanks for your suggestion,
indeed it is called for each row. That's my problem. A better solution
which just extract the last result is:
package require sqlite
sqlite sql d:/data/yaspo2004bt.sqlite
sql function median Median
set l [list]
proc Median {value} {
global l
lappend l $value
re
4 matches
Mail list logo