Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    chennai
    Posts
    30

    Question Unanswered: Query response time

    Hi all,

    I have a query which counts the number of records in a table with a where condition. I have two options for that one is using a date function in where clause and the other using a between in the where clause. I want to know which query will execute faster. For eg the queries are given below:

    SELECT COUNT(*) FROM CORPDB.BOP_PICKT
    WHERE DATE(INS_TS) = '2003-02-19'
    AND PRD_NUM=4
    AND INVT_SITE_NUM=1 AND USER_SORT_CAT_CD=8;

    SELECT COUNT(*) FROM CORPDB.BOP_PICKT
    WHERE
    INS_TS BETWEEN '2003-02-19-00.00.00.000001'
    AND '2003-02-19-23.59.59.999999'
    AND PRD_NUM=4
    AND INVT_SITE_NUM=1 AND USER_SORT_CAT_CD=8;
    Thanks,
    sekhar rao k

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605

    Re: Query response time

    Hi,

    Please read http://dbforums.com/t698301.html

    Hope this helps,
    Grofaty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •