|
|
|
Re: Replacing First Five Digits in SSN [message #416985 is a reply to message #416975] |
Wed, 05 August 2009 09:14 |
flyboy
Messages: 1903 Registered: November 2006
|
Senior Member |
|
|
v1960u wrote on Wed, 05 August 2009 15:56 | Hi SQL GURU's,
I am very new to programming and I have a request to create a report selecting data from HR warehouse table out putting personal data including SSN. but SSN display must be first five digits will show like 999992371.
|
Firstly, this does not seem to be SQL problem, only the logical one.
Secondly, you should exactly formulate, what you want. Then it would be easy to find suitable Oracle functions for achieving it.
Based on the posted example, you may want:
- show '99999' instead of first 5 SSN digits - use constant string '99999'; if you want to show less number of '9's when SSN has less than 5 digits, you may use LPAD/RPAD combined with LENGTH to get required number of '9's
- concatenate it with the rest of SSN (from 6th digit to the end - use SUBSTR)
|
|
|
|
|
Re: Replacing First Five Digits in SSN [message #416999 is a reply to message #416995] |
Wed, 05 August 2009 10:12 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Michel Cadot wrote on Wed, 05 August 2009 16:56 | Quote: | probably I may hit enter multiple times.
|
Sure, next time FIRST go to forum topic list and THEN ONLY IF your topic is not there repost.
|
That might prove to be a bit hard if your computer hangs.
Had a duplicate post myself the other day, whereas I am 100% clear that I sumitted only once, so let's not be too harsh on others.
|
|
|
Re: Replacing First Five Digits in SSN [message #417000 is a reply to message #416995] |
Wed, 05 August 2009 10:14 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Michel Cadot wrote on Wed, 05 August 2009 16:56 | Quote: | probably I may hit enter multiple times.
|
Sure, next time FIRST go to forum topic list and THEN ONLY IF your topic is not there repost.
|
That might prove to be a bit hard if your computer hangs.
Had a duplicate post myself the other day, whereas I am 100% clear that I sumitted only once, so let's not be too harsh on others.
|
|
|
|
|
|
|