I have a concatenation problem. I can get the left parentheses to display but not the right. Here is what should happen, if column 2 is populated the concatenate col1 with parens around col2. If col2 is null then concatenate col1 with parens around a dash. It functions properly for placing the das in the field, I'm just having trouble closing the paren. Help is always greatly appreciated. Please see example.
col1 || '('|| NVL(col2,'-') || ')' || as NewCol,
Result should be:
1 Data1 (Data2) 2 Data1( - )
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.