Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Checking for existence [newbie]

Checking for existence [newbie]

From: mar <mar_at_foo.com>
Date: Fri, 16 May 2003 00:27:52 +0200
Message-ID: <ba149k$o9oc9$1@ID-174077.news.dfncis.de>


I have to find out the existence of tasks for an employee, and for a time period.

Now I do

SELECT COUNT(*)
FROM TASKS
WHERE EMPNO = 239 AND
    TASK_DATE >= SYSDATE-4 AND
    TASK_DATE <= SYSDATE-1;

If COUNT(*) gives value greater than 0,
then I know that that employee had some tasks in the given time period. However is there a better trick? Function COUNT(*) is too slow and I have to find just ONE row. Received on Thu May 15 2003 - 17:27:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US