Home » SQL & PL/SQL » SQL & PL/SQL » How to use alias name for a column in sql query (SQL)
How to use alias name for a column in sql query [message #315590] Tue, 22 April 2008 01:41 Go to next message
yogeshyl
Messages: 50
Registered: October 2007
Location: Silvassa
Member
I have a column TD_SUB_ACNT_CODE in Oracle table. I want to split the details in this column in two columns namely Debit and Credit. How could i use the same column for this purpose?

The column contains the following data:

E0516001
E0522003
E0522004
A0402004
E0522002
A0402004

Here the account code A0402004 should be displayed separately in Credit column, and the other details in Debit column.


Kindly sugget?

Yogesh
Re: How to use alias name for a column in sql query [message #315592 is a reply to message #315590] Tue, 22 April 2008 01:44 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
use DECODE()

regards,

[Updated on: Tue, 22 April 2008 01:44]

Report message to a moderator

Re: How to use alias name for a column in sql query [message #315593 is a reply to message #315592] Tue, 22 April 2008 01:51 Go to previous messageGo to next message
yogeshyl
Messages: 50
Registered: October 2007
Location: Silvassa
Member
What is the syntax?
Re: How to use alias name for a column in sql query [message #315595 is a reply to message #315593] Tue, 22 April 2008 01:55 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Check the documentation on http://tahiti.oracle.com
Previous Topic: ORA-01722 INVALID NUMBER
Next Topic: problem with table trigger?
Goto Forum:
  


Current Time: Fri Dec 09 11:26:01 CST 2016

Total time taken to generate the page: 0.08202 seconds