Jump to content

SQL Alias question


Recommended Posts

In my query I have a mathematic function under an alias:

 (a amount+ b amount) AS "difference" 


Now however I need to sum the difference, but apparently you cannot sum information using an alias:

 SUM('difference') AS "total_difference" 


I get a ORA-01722: invalid number error.


Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...