Search Postgresql Archives

Re: Removing Last field from CSV string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/16/20 9:31 AM, PALAYRET Jacques wrote:
Hello,

Perhaps, a statement like :
   substring(theString, 1, length(theString)-position(',' IN reverse(theString)))

with theString   'Class V,Class VI,Class VII,Competitive Exam,Class VIII*,Class' for example.

That's cool. I did a little fiddling with above:

SELECT
    substring(
left('Class V,Class VI,Class VII,Competitive Exam,Class VIII,Class X,Class XI,Class IX,Class XII', 60), 1, length( left('Class V,Class VI,Class VII,Competitive Exam,Class VIII,Class X,Class XI,Class IX,Class XII', 60)) - position(',' IN reverse( left('Class V,Class VI,Class VII,Competitive Exam,Class VIII,Class X,Class XI,Class IX,Class XII', 60))))


  substring
--------------------------------------------------------
 Class V,Class VI,Class VII,Competitive Exam,Class VIII


Regards
----- Météo-France -----
PALAYRET JACQUES
DCSC/MBD
jacques.palayret@xxxxxxxx
Fixe : +33 561078319


--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux