On 18 Aug 2009, at 6:06pm, andrew fabbro wrote:

> What is the most efficient way to code either a trigger or the app  
> so that
> it increments a "count" field if the "id" field exists?
>
> For example, say you have a table with fields of "id" and "count".
>
> First row is an id of 3, so "count" is set to 1.
> Next row is an id of 4, so "count" is set to 1.
> Third row is an id of 3 again, so "count" is incremented to 2.

Isn't there a way to express 'count' as a calculation, like 'max', so  
you don't have to store the value in a field ?

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to