Substring Query returning null

Nick

I have this query where im returning a facebook profile link like this https://www.facebook.com/profilename/. Now i want that the first part of the link to not show up which is this https://www.facebook.com/ so only the username is displayed but the query is displaying nothing.

Query

SELECT facebook_link FROM users WHERE SUBSTRING_INDEX(facebook_link, 'm/', -1)) 
RiggsFolly

You have to manipuldate the selected data, the where clause does nothing to the column selected

SELECT SUBSTRING_INDEX(facebook_link, 'com/', -1) as facebook_link 
FROM users

And to get rid of the trailing / try

SELECT TRIM(TRAILING '/' FROM SUBSTRING_INDEX('https://www.facebook.com/profilename/', 'com/', -1))
FROM users

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related