I’m trying to name a new column in my view… here is (part of) my code:
SELECT co_url_name, score_combined,(SELECT trunc(("productAndServices" + "futurePurchase" + shipping + "customerService" + returns + "lifetimeRating")/6, 2) AS resellerRating)
Basically it’s just an average of a bunch of columns.
However, the column comes up named ?column? instead and was wondering how I need to change my syntax to name the column resellerRating instead.
I tried ALTER VIEW myview RENAME COLUMN "?column?" TO resellerRating; and not surprisingly got an error…. can anyone help me figure this out?
Change your view definition to this:
If you want to post your whole query here, I can refactor it, but as it were, you need to put the alias outside the subquery.