Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any way to speed this select?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01125229
Message ID:
01125351
Views:
20
how about:
select count(trans.cTrans_pk) as iAccounts_Count, ;
	step1.cUsGrLink_pk, ;
	sum(trans.yCurrent_balance_amount) as yBalance ;
	from trans ;
	INNER join ;
	(select TEQ.cTrans_fk, ;
	iif(not isnull(TEQ.cCommission_Owner_UsGrLink_fk), ;
	TEQ.cCommission_Owner_UsGrLink_fk, ;
	TEQ.cUsGrLink_fk) as cUsGrLink_pk from Employee_Queue_Schedules EQS ;
	INNER join Trans_Employees_Queues TEQ ;
	on TEQ.cTrans_Employees_Queues_pk = EQS.cTrans_Employees_Queues_fk ;
	where TEQ.iActive_Flag = 1 ;
	and EQS.iActive_Flag = 1  and ;
      and EQS.tScheduled_time <= m.ltTime 
	iif(not isnull(TEQ.cCommission_Owner_UsGrLink_fk), .t., ;
	(TEQ.iTemporary_Assignment_Flag = 1 and ;
	TEQ.tStart_Date <= m.ltTime and ;
	TEQ.tExpire_Date >= m.tdDate))) step1 ;
	on trans.cTrans_pk = step1.cTrans_fk ;
	where trans.cResolution_Codes_fk is null ;
	group by 2 into cursor (m.tcAlias) readwrite
with making sure that there is an index on step1.cUsGrLink_pk and
on TEQ.cTrans_Employees_Queues_pk and
on EQS.cTrans_Employees_Queues_fk and
on TEQ.iActive_Flag
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform