Results 1 to 2 of 2

Thread: how to fetch record(s) which is having

  1. #1
    Join Date
    Dec 2004
    Posts
    33

    how to fetch record(s) which is having

    Hi

    I have one table which is having some records as below.
    reqno empno deptno fromdate vac_days
    1 4230165 201135 1429/07/03 5
    2 4230165 201135 1429/07/10 4
    3 6000144 201135 1429/07/15 6
    4 6000144 201135 1429/07/15 5
    5 6000103 201136 1429/07/15 4

    now, i want records of all empno which vacation days are less than 10 days.

    the output should be like.

    1 4230165 201135 1429/07/03 5
    2 4230165 201135 1429/07/10 4
    5 6000103 201136 1429/07/15 4

    here only 6000144 empno record(s) will not be displayed because it has vacation days total more than 10 days.

    Please help me.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Create a inline view with group by empno and put having sum(vac_days)<10 condition then join this with the table to get remaining fields.

Posting Permissions

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