digimortal
Programmer
I'm trying to run a select query on 5 tables but it seems my code is not efficient enough please help... BTW it gives me a timeout error. I don't know but maybe the problem is that there are 2500 records on my card table...
Code:
SELECT CARD.LNAME, CARD.MNAME, CARD.CNUM, CARD.CNAME, (CASE WHEN Card.GNUM = C_GRP.NUM THEN C_GRP.NAME ELSE NULL END) AS Departman,
(CASE WHEN AGRECS.AGNUM = CARD.ACGRP THEN AGRECS.AGNAME ELSE NULL END) AS AGN,
(CASE WHEN PersonelWG.WGID = WorkGroups.WGID THEN WorkGroups.WGName ELSE NULL END) AS WG
FROM CARD CROSS JOIN
C_GRP CROSS JOIN
AGRECS CROSS JOIN
WorkGroups CROSS JOIN
PersonelWG