Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL

Status
Not open for further replies.

owenyuen

Programmer
Feb 19, 2003
22
0
0
US
I have some data in my table declared in varchar
2000
200
20
2

Is any way I can write a SQL to output those data as

2000
0200
0020
0002

Many Thanks
 
If all data in the column is numeric:
Code:
select to_char(to_number(column_name),'099999') my_value
from   my_table
order by 1;

Good Luck!

Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
[sup]When posting code, please use TGML for readability. Thanks![sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top