• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

SQL Developer Last four of the Social Security

I am using Oracle SQL Developer and I am trying to produce a report that will only give me the last four of the social security number.  The normal format is XXX-XX-XXXX , but I will only like the last four.
I tried
Select right(table.SS, 4 from table where.........        but this doesn't work.


Select Right(table.SS, -4) from table where.....
1 Solution
slightwv (䄆 Netminder) Commented:
If you always want the last 4 no matter what:
select substr('123-45-6789',-4) from dual;
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now