خرید بک لینک

Vote count: 0

Im trying to select all substings from certain URL's but I know there is a smarter way to do it.

Her is what I need:

from the URL:

http://www.example.com/a-b-c-d-123-456.html

I would like to get everything before the last 2 '-', so in this case:

http://www.example.com/a-b-c-d

this is the approach I am using now, it gets the job done but it's pretty rustic:

select array_to_string((string_to_array(url,'-'))[1:array_length(string_to_array(url,'-'),1)-2],'-')

asked 5 secs ago

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 23 تير 1395 ساعت: 16:41

صفحه بندی