View previous topic :: View next topic
|
Author |
Message |
yogeshbabu
New User
Joined: 30 Nov 2005 Posts: 19 Location: India
|
|
|
|
Hi All,
I need a optimised query , which selects and stops when one row satisfying the given condition say for example emp_salary>10000 is met.
The query should not proceed further.
I need this query in order to reduce the DB2 cost and improve performance.
Thanks & Regards,
Yogesh. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
If you use
Code: |
FETCH FIRST 1 ROWS ONLY
|
at the end of your query should satisfy your requirement .
If this is not what you need, please explain further.
Dave |
|
Back to top |
|
|
yogeshbabu
New User
Joined: 30 Nov 2005 Posts: 19 Location: India
|
|
|
|
Thanks Dave
This is what I needed.
Regards,
Yogesh. |
|
Back to top |
|
|
|