aliases cannot be referred to in the select list, or anywhere else for that
matter, except in the order by clause
but you can put your query in an in-line query and then reference the aliases in
the outer query
for instance
select .... cases_this_month || ' -- ' || dollars_this_month ....
from (
select ...
, brk.division division
, SUM((NVL(rctl.quantity_invoiced,0)* NVL(msi.attribute13,1)) +
(NVL(rctl.quantity_credited,0)* NVL(msi.attribute13,1)))
cases_this_month
SUM(NVL(rctl.revenue_amount,0)) dollars_this_month
, msi.attribute12
... and the rest of your original query here
)
----- Original Message -----
From: oamen
To: VOUGlist@yahoogroups.com
Sent: Wednesday, February 14, 2007 3:29 PM
Subject: (VOUG) Concatenating alias columnms
HI,
I am trying to concatenate two column alises and am getting an error.
If I use only one alias and keep the other column as it is, the
concatenation works fine..But if I use aliases for two columns and try
to concatenate the two, it doesn't work.
The statement is like this...
-----
, brk.division division
, SUM((NVL(rctl.quantity_invoiced,0)* NVL(msi.attribute13,1)) +
(NVL(rctl.quantity_credited,0)* NVL(msi.attribute13,1)))
cases_this_month
SUM(NVL(rctl.revenue_amount,0)) dollars_this_month
, msi.attribute12
here I want to be able to concatenate cases_this_month and
dollars_this_month..
Any help would be appreciated.
Thanks
Asgar
[Non-text portions of this message have been removed]