newbie query (decode) experts opinion wanted ;)
From: oranewbie <teekgeek99_at_hotmail.com>
Date: 22 Jan 2002 12:08:37 -0800
Message-ID: <a606c112.0201221208.7c38f9e2_at_posting.google.com>
[Quoted] I would like some input on if this query, that I've written, is the best way to go about things. I thought perhaps inclusion of a decode statement might make things run faster, but I'm not sure. Thanks.
Date: 22 Jan 2002 12:08:37 -0800
Message-ID: <a606c112.0201221208.7c38f9e2_at_posting.google.com>
[Quoted] I would like some input on if this query, that I've written, is the best way to go about things. I thought perhaps inclusion of a decode statement might make things run faster, but I'm not sure. Thanks.
a.*,
from table1 a,
table2 b
where
( a.employee_num = b.employee_num and a.test_id = 1 and
a.employee_num = 'SA' and ((a.test_score >= b.test_score_min
and a.test_score < b.test_score_max) or
(a.test_score >= b.test_score_min and b.test_score_max is null ) )
and (case when b.department_flag is null then '1'
when b.department_flag = 'Y' and a.department_flag = 'Y'
then '1'
when b.department_flag = 'N' and a.department_flag = 'N'
then '1'
else ' ' end ) = '1')
opinions? Received on Tue Jan 22 2002 - 21:08:37 CET
