|
|
|
|
|
Re: SQL Help [message #619517 is a reply to message #619477] |
Wed, 23 July 2014 02:37 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
superboy87 wrote on Wed, 23 July 2014 03:34SELECT SUBSTR(recordName, 0, INSTR(recordName, ':')-1) AS output
FROM TableName
That would not ONLY return DIGITS, but anything it finds before the first occurence of ":".
SQL> WITH DATA as(
2 SELECT '10:1-250:US17' str FROM dual UNION ALL
3 SELECT '5:1-250:US17' str FROM dual UNION ALL
4 SELECT ':1-250:US17' str FROM dual UNION ALL
5 SELECT 'A:1-250:US17' str FROM dual)
6 SELECT substr(str, 0, instr(str, ':') - 1) str FROM data;
STR
-------------
10
5
A
|
|
|
Re: SQL Help [message #619528 is a reply to message #619517] |
Wed, 23 July 2014 03:38 |
|
Michel Cadot
Messages: 68625 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Maybe the following will help:
Quote:what i need is the numbers before the first :
|
|
|