RE: Re: Re: Allow Reg Expressions in Position function

2018-08-20 Thread Nick Dro
כתב: On Mon, 20 Aug 2018 at 09:22, Nick Dro <postgre...@walla.co.il> wrote: This incorrect. SELECT position(substring('https://www.webexample.com/s/help?' FROM '/(s|b|t)/') IN 'https://www.webexample.com/s/help?');   Gives 5. It's wrong.On Mon

RE: Re: Allow Reg Expressions in Position function

2018-08-20 Thread Nick Dro
ning SUBSTRING with position.  Something like:SELECT position(substring(URL FROM '/(s|b|t)/') IN URL);Cheers,KenOn Sun, Aug 19, 2018 at 11:27 PM Nick Dro <postgre...@walla.co.il> wrote:Position function allows only string as pattern parameter:   select position(sub-string in string)

Allow Reg Expressions in Position function

2018-08-19 Thread Nick Dro
Position function allows only string as pattern parameter:   select position(sub-string in string)   If you are looking for more than one sub-string you can't do it with a single call to position. More info:  https://stackoverflow.com/questions/51925037/how-to-find-position-of-multiple-sub-string-i

RE: Re: Re: PostgreSQL needs percentage function

2017-12-20 Thread Nick Dro
n it make sence to have it in it's base code - ready for use rather than ask each one to implment his own.     ב דצמ׳ 19, 2017 17:51, Melvin Davidson כתב: On Tue, Dec 19, 2017 at 4:54 AM, Pavel Stehule <pavel.steh...@gmail.com > wrote: 2017-12-19 10:13 GMT+01:00 Nick Dro <postg

RE: Re: PostgreSQL needs percentage function

2017-12-19 Thread Nick Dro
postgresql should have build in function for percentage calculation it doesn't have to me the exact example I gave. Any thing will be better than none.     ב דצמ׳ 18, 2017 18:28, Michael Nolan כתב: On Mon, Dec 18, 2017 at 6:23 AM, Nick Dro <postgre...@walla.co.il > wrote: Hi, Why

RE: Re: PostgreSQL needs percentage function

2017-12-18 Thread Nick Dro
very basic mathematical operations.   Can you give a good reason why absolute value has a build in function while percentage is not? ב דצמ׳ 18, 2017 17:44, hubert depesz lubaczewski כתב:On Mon, Dec 18, 2017 at 02:23:38PM +0200, Nick Dro wrote: >Hi, >Why PostgreSQL doesn't have build-in

PostgreSQL needs percentage function

2017-12-18 Thread Nick Dro
Hi, Why PostgreSQL doesn't have build-in function to calculate percentage? somthing like percent(number,% for example: select percent(100,1) will calculate 1% of 100 = 1 select percent(25,20) will calculate 20% of 25 = 5   Seems like a nice addition to the math functions list: https://www.postgresq