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

Create a View 1

Status
Not open for further replies.

szaunbr

Technical User
Jul 5, 2006
50
US
I would like to create a view of an entire table as is but with one exception. I would like to change the format of the SSN field. I would like to add the dashes into the SSN field, and select every other field in the table and create that as my view.
 
Hi

For that you need to enumerate all other fields or give a distinct name to the formatted field.
Code:
[b]select[/b]
[b]create view[/b] szaunbr_view [b]as[/b]
substring(ssn,1,3)||[i]'-'[/i]||substring(ssn,4,2)||[i]'-'[/i]||substring(ssn,6) [b]as[/b] ssn_formatted,*
[b]from[/b] szaunbr

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top