Home > Enterprise >  how to remove all string after question mark in mysql query
how to remove all string after question mark in mysql query

Time:07-05

I have a column of urls like http://mydomain/app?u=asdfa&b=fnsn with varying number of parameters. I would like to remove all the string after question mark onwards and get distict urls.

CodePudding user response:

substring_index(url, '?', 1)

will return everything before the first ? or the entire url if there is no ?

  • Related