Mysql
 sql >> Database >  >> RDS >> Mysql

SUBSTRING_INDEX con più delimitatori

Usa IF

SELECT SUBSTRING_INDEX(refurl, IF(LOCATE('?gclid', refurl), '?gclid', '&gclid'), 1) AS refurl, ...