Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 14369 invoked from network); 22 Nov 2007 14:41:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2007 14:41:25 -0000 Received: (qmail 64381 invoked by uid 500); 22 Nov 2007 14:41:12 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 64354 invoked by uid 500); 22 Nov 2007 14:41:11 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 64343 invoked by uid 99); 22 Nov 2007 14:41:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Nov 2007 06:41:11 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [206.190.38.208] (HELO web51603.mail.re2.yahoo.com) (206.190.38.208) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 22 Nov 2007 14:41:14 +0000 Received: (qmail 98957 invoked by uid 60001); 22 Nov 2007 14:40:52 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=xYgHhVGNDrTBuR+LGDYUDWRLbhEbWZRhdz7yBPFYg7qUIVVWQAG8rzgfCbWrZ4Gxpr5AXG67akt0YUL2SzJGoFr8iT368bfOcGrDxOLkXHEIyLGrJsWdY1gs2tKTde9lfwPNE00oNE5vc6qE/AdVVZg+lL5i19iq3BIoWRsvWdk=; X-YMail-OSG: 1mqfyiQVM1mUbCuFZTYn04TY5jrvILjKmTYqRMcoFEOGVAnn9wc9o7aSAktMyIMMXzahN7k4S1qPrvA9K4O2kHRCpre_xF_bw5rix5qFLXMJjH_UH8T1v0Y075Q_Kg-- Received: from [196.12.47.99] by web51603.mail.re2.yahoo.com via HTTP; Thu, 22 Nov 2007 06:40:52 PST Date: Thu, 22 Nov 2007 06:40:52 -0800 (PST) From: Aneez Backer Subject: Re: Derby Equivalent of MySql queries To: Derby Discussion In-Reply-To: <20071122095036.GA22923@khepri35.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1310316641-1195742452=:98927" Content-Transfer-Encoding: 8bit Message-ID: <738361.98927.qm@web51603.mail.re2.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-1310316641-1195742452=:98927 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi The tables are being used for dynamic update and count of notification whenever a pre-defined change is made in any of the columns. Also, I had posted the trigger statement in a simplified form omitting data from it for which I knew I could work on myself. Hope that answers your query. Can you help me with one more transformation?? select * TABLEA where uid in (101,102,103) order by creation_time limit 5" The problem here is with the 'limit 5' part of the query Also, can you let me know of any online tutorial help available for learning Derby Query basics ?? Thanks -aneez "Bernt M. Johnsen" wrote: Hi, >>>>>>>>>>>> Aneez Backer wrote (2007-11-21 20:05:01): > Thanks Bernt. > > That helped Just a small question: Is there some special (e.g. performance) requirements that force you to maintain the data in TABLEB? Since SELECT TAGCOUNT FROM TABLEB WHERE ID=xxx; should give the same result as SELECT COUNT(TAG_ID) FROM TABLEA WHERE TAG_ID=xxx; you could perhaps do without the triggers and TABLEB? -- Bernt Marius Johnsen, Database Technology Group, Staff Engineer, Derby/Java DB Sun Microsystems, Trondheim, Norway --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. --0-1310316641-1195742452=:98927 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi

The tables are being used for dynamic update and count of notification whenever a  pre-defined change is made in any of the columns. Also, I had posted the trigger statement in a simplified form omitting data from it for which I knew I could work on myself.

Hope that answers your query.

Can you help me with one more transformation??

select * TABLEA where uid in (101,102,103) order by creation_time limit 5"

The problem here is with the 'limit 5' part of the query

Also, can you let me know of any online tutorial help available for learning Derby Query basics ??

Thanks
-aneez

"Bernt M. Johnsen" <Bernt.Johnsen@Sun.COM> wrote:
Hi,

>>>>>>>>>>>> Aneez Backer wrote (2007-11-21 20:05:01):
> Thanks Bernt.
>
> That helped

Just a small question: Is there some special (e.g. performance)
requirements that force you to maintain the data in TABLEB? Since

SELECT TAGCOUNT FROM TABLEB WHERE ID=xxx;

should give the same result as

SELECT COUNT(TAG_ID) FROM TABLEA WHERE TAG_ID=xxx;

you could perhaps do without the triggers and TABLEB?
--
Bernt Marius Johnsen, Database Technology Group,
Staff Engineer, Derby/Java DB
Sun Microsystems, Trondheim, Norway





Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. --0-1310316641-1195742452=:98927--