Understanding the RIGHT() Function in PostgreSQL

In PostgreSQL the right() function returns the specified number of rightmost characters in a given string.

We have the option of specifying the number of characters to return from the right or the number of characters to omit from the left. We do this by specifying a positive integer (to return n number of rightmost characters) or a negative integer (to return everything except n leftmost characters).

Continue reading

A Quick Look at the LEFT() Function in PostgreSQL

In PostgreSQL we can use the left() function to get the specified number of leftmost characters in a given string.

We have the option of specifying the number of characters to return from the left or the number of characters to omit from the right. We do this by specifying a positive integer (to return n number of leftmost characters) or a negative integer (to return everything except n rightmost characters).

Continue reading