954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Oracle Sql

I am new to Oracle and SQL. I need to write a select statement for a student extract at a college. For ex:

select ss_id from id_table

This will return all id's from this table and they are a length of 9 digits, i need to return just the last 6 so i can import them as student passwords. Any help would be appreciated. Thanks. Also i am using TOAD, and/or SQL Plus

chevyww1936
Newbie Poster
2 posts since Feb 2009
Reputation Points: 16
Solved Threads: 0
 

select substr(ss_id, 4, 6) from id_table

http://www.1keydata.com/sql/sql-substring.html

Sulley's Boo
Posting Pro in Training
452 posts since Dec 2004
Reputation Points: 529
Solved Threads: 10
 

Thank you very much, that is exactly what i needed. This was the 3rd forum i tryed in a list from google and you are the first to get it right, and i also appreciate the link.

chevyww1936
Newbie Poster
2 posts since Feb 2009
Reputation Points: 16
Solved Threads: 0
 

Other method:

select substr(ss_id, -6) from id_table

I am new to Oracle and SQL. I need to write a select statement for a student extract at a college. For ex:

select ss_id from id_table

This will return all id's from this table and they are a length of 9 digits, i need to return just the last 6 so i can import them as student passwords. Any help would be appreciated. Thanks. Also i am using TOAD, and/or SQL Plus

ccerdeira
Newbie Poster
2 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

select substr(ss_id, -6) from id_table

this should work for you

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You