Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query

Status
Not open for further replies.

leo6

Programmer
Mar 2, 2005
22
US
can the below DB2 query be optimised ?

select dense_rank() over(order by emp_no)
from employee_role a
where grade = 1
and ( emp_status like '%3%' or emp_status like '%6%' or emp_status like '%4%' )
and entryid > (select COALESCE(max(entryid),a.entryid-1) from employee_role
where emp_no=a.emp_no
and design_status='C1'
and grade=1 )
group by emp_no

 
I don't know. But I suggest you ask your question in a DB2 forum. This forum is for a specific product:

Microsoft SQL Server: Programming.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top