Database Tuning (MOSC)

MOSC Banner

How to rewrite this???

edited May 4, 2009 12:33PM in Database Tuning (MOSC) 3 commentsAnswered
Hello All,
 I have a query like this

SELECT bo_no AS ins_no, bo_year AS ins_year, '11' AS trade_type,
flag_atypical
FROM one_re_client
WHERE bo_class = 'INS' AND flag_atypical = 'Y'
UNION ALL
SELECT
bo_no AS ins_no, bo_year AS ins_year, '21' AS trade_type,
flag_atypical
FROM one_re_client
WHERE bo_class = 'INS' AND flag_atypical = 'Y'


1. Is there a way to combine these two statements into one?? I want to access the table only once. Is that possible??

And another thing in the table there are NO rows for the condition "flag_atypical = 'Y'" but unfortunately to come out with 0 rows it takes a lot of time. flag_atypical column is NOT included in any index. How do I tune this.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center