note 56196 added to function.ociresult
| From: | luismanuelp at gmail dot com | Date: | Fri, 26 Aug 2005 15:05:09 +0000 |
| Subject: | note 56196 added to function.ociresult | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94227@lists.php.net to get a copy of this message | ||
I am trying to get a list of the first character of a character string.
SELECT distinct substr(version,1,1) as COL1 FROM SPHVVERS where Version is not null order by 1
This was working and then failed recently. I think it is because some of the strings now added
contain a number as the first character.
I found to get it to work I had to use decode statement. (To_Char did not work )
SELECT distinct decode
(substr(version,1,1),'1','?','0','!',substr(version,1,1)) as
COL1 FROM SPHVVERS where Version is not null order by 1
----
Manual Page -- http://www.php.net/manual/en/function.ociresult.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56196
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56196&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56196&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56196&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56196&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56196&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56196&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56196&report=yes
Search -- http://master.php.net/manage/user-notes.php