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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Select text replace 1

Status
Not open for further replies.

deulyd

Programmer
Oct 17, 2001
106
CA
Hi,

I'd like to know if there is a way to do that in an SQL query :

I have a table with the following fields and data

ID TYPE
------- ----------
1 CALL
2 CALL
3 INTERNAL
4 EMAIL
5 CALL

I'd like to have an SQL statement that would return me the following by replacing :

CALL by 'E'
EMAIL by 'E'
INTERNAL' by 'I'

ID TYPE
------- ----------
1 E
2 E
3 I
4 E
5 E


Thanks

Daniel
 
Try this.

Decode(type,'INTERNAL','I','E') type
 
Thanks, It's exactly what I was looking for! :D

Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top