#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    1
    Rep Power
    0

    How to Reverse string?


    Hello everyone,

    In postgresql, I have string: "One,two,Three" and how to I Reverse it to "Three,Two,One"? hepl me, pleases.

    Thanks all
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,911
    Rep Power
    1045
    Hi,

    I smell a 1NF violation.

    Why do you even have this strange string, and what do you need it for? If you store your data as comma-separated strings, you're doing it wrong (see the link above). As a rule of thumb: When you need complicated string operations, it's usually a warning sign telling you that your data model is incorrect or that you're doing things with PostgreSQL which you should be doing with your application.

IMN logo majestic logo threadwatch logo seochat tools logo