[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
[sqr-users] Problem in SQL
- Subject: [sqr-users] Problem in SQL
- From: Deepu <pradeepkanneganti@yahoo.com>
- Date: Wed, 13 Oct 2004 06:38:23 -0700 (PDT)
- Cc:
- Delivery-date: Thu, 14 Oct 2004 09:30:24 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
Hi All,
I'm having a problem with this sql..which is retreviing around 3 million rows.
SELECT
a.emplid, a.NAME, pers1.national_id, b.hire_dt, b.rehire_dt, b.termination_dt,
c.deptid, c.full_part_time, c.action, c.action_reason, c.action_dt, c.effdt,
c.reg_temp, c.empl_status, c.empl_rcd
FROM
ps_names a, ps_pers_nid pers1, ps_employment b, ps_job c, ps_person person
WHERE
person.per_status = 'E' AND a.emplid = c.emplid
AND a.emplid = pers1.emplid
AND pers1.country = 'USA'
AND pers1.national_id_type = 'PR'
AND b.emplid = c.emplid
AND ( c.effdt =
(SELECT MAX (effdt), FROM ps_job h
WHERE h.emplid = c.emplid AND h.empl_rcd = c.empl_rcd AND h.effdt <=
'30-JUN-2001')
AND c.effseq = (SELECT MAX (effseq) FROM ps_job i
WHERE i.emplid = c.emplid AND i.empl_rcd = c.empl_rcd
AND i.effdt = c.effdt))
AND b.barg_unit = '9' AND c.full_part_time != 'D'
AND a.name_type = 'PRI'
AND a.effdt = (SELECT MAX (effdt) FROM ps_names a1
WHERE a.emplid = a1.emplid AND a.name_type = a1.name_type)
ORDER BY C.Reg_Temp,C.Empl_Status,A.Name
I was trying to tune this sql...can any one pls suggest me on how to do
it...any help is highly appreciated.
Thanks,
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users