Home » SQL & PL/SQL » SQL & PL/SQL » positive or negative add a new column (oracle 8)
positive or negative add a new column [message #310284] Mon, 31 March 2008 17:54 Go to next message
mrang14
Messages: 2
Registered: March 2008
Junior Member
i'm totally new in sql and oracle and i have my first query, i have a table where i can see values and accounts with debit and credit values, i do not have a table with the accounts and the value to get if an account is credit or debit, so the only data that i have is the table with positive and negative values.
i need create a report with the requested fields and add a column "D" for the negative values and "C" for the positive values. I just have one table to create it.

tablename sample
6110,1880,1235.25,1/1/07,,,,
6110,2010,-1235.25,1/1/07,,,

select cc,account,value,date from tablename

and i need this output (something like this)

1880,1235.25,1/1/07,c
2010,-1235.25,1/1/07,d
..
..
..

any support will be appreciate

thanks in advance people of the forum
Re: positive or negative add a new column [message #310309 is a reply to message #310284] Mon, 31 March 2008 20:48 Go to previous messageGo to next message
flyboy
Messages: 1832
Registered: November 2006
Senior Member
Welcome to the forum. Especially as a newbie, you should consult the documentation, found eg. online on http://tahiti.oracle.com/. As you realize there, the latest release has version 11.1; version 8 (what is yours with all four decimals?) is very old, long ago de-supported and even not listed there. Maybe it is time to upgrade it.

If you do not have it on Oracle installation CDs, you may search it on the internet. I found some references to paperbook stores, but maybe you will have better luck. Here I link to documentation for 8.1.7 (8i) documentation, as these constructions should not change:
DECODE expression
SIGN function
Re: positive or negative add a new column [message #310561 is a reply to message #310309] Tue, 01 April 2008 11:55 Go to previous message
mrang14
Messages: 2
Registered: March 2008
Junior Member
thanks for your feedback... i will start looking for what i need. thanks againg.

Previous Topic: problem using utl_file package
Next Topic: updating tables with foreign keys
Goto Forum:
  


Current Time: Sat Dec 10 03:02:15 CST 2016

Total time taken to generate the page: 0.06212 seconds