Beegee | Tu ne peux pas utiliser les alias de même niveau.
Fais une sous-requête :
Code :
- select c_current_rating,
- c_previous_rating,
- CURRENT_RANK,
- PREVIOUS_RANK,
- case
- when CURRENT_RANK > PREVIOUS_RANK then 'DNG'
- when CURRENT_RANK < PREVIOUS_RANK then 'UPG'
- when CURRENT_RANK = PREVIOUS_RANK then Null
- else null
- end
- from (select w.c_current_rating,
- w.c_previous_rating,
- (select n.RANG_MOOD from r_note_ref_mo n where n.C_RATING_MOOD(+) = w.C_CURRENT_RATING) CURRENT_RANK,
- (select n.RANG_MOOD from r_note_ref_mo n where n.C_RATING_MOOD(+) = w.C_PREVIOUS_RATING) PREVIOUS_RANK
- from rdt_fs_histo_mo_w w);
|
|