I have the table "behavior" and a column "url". The column "url" contains some rows as below.
What I want to do is to change the rows of column "url" such as
/this-is/the-main-url?fbclid=IwAR1VIvXLBSIs4S_eRc4FGVYhIsiViWPEBBSmpkHMatjAcH0Rh-_u4VGoo
to
/this-is/the-main-url
and likewise this
/here-is/another-url?utm_source=facebook&utm_medium=cpc&utm_campaign=fb.traffic
to
/here-is/another-url
of the behavior table.
So, if the string contains ?fbclid
or ?utm_source
to keep everything before it.
This can be done also by using multiple queries, instead of one complex.
NOTE: The utm_source or fbclid, parameters and ids can be various, so I need a dynamic solution.
Thank you