Igor,

Amazing.  Thanks very much for your help.  You get credit in my code comments 
:-))

 -Clark

----- Original Message ----
From: Igor Tandetnik <[EMAIL PROTECTED]>
To: SQLite <sqlite-users@sqlite.org>
Sent: Tuesday, April 3, 2007 12:20:57 PM
Subject: [sqlite] Re: SQL help

Clark Christensen <cdcmicro-/[EMAIL PROTECTED]>
wrote:
> I have a table, as described below, where I need to find out if the
> tech_id in question has at least some modules in a particular
> collection (coll_id), and they're all complete.

select coalesce(min(is_complete), 0) from tech_modules
where tech_id=? and coll_id=?;

This returns 0 if there's at least one record with is_complete=0 (min 
will select it), or if there are no matching records at all (min will 
produce NULL, coalesce will convert it to 0).

Igor Tandetnik 


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------





-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to