SQL在线练习

https://h.w.com/lin/h

select SUBSTRING_INDEX("https://h.w.com/lin/h", '/', 3)

效果:

https://h.w.com

huangwanlin

SELECT left("huangwanlin" ,5)

效果:

huang

huangwanlin

SELECT RIGHT("huangwanlin",6)

效果:

wanlin

huangxiaoming

SELECT REPLACE("huangxiaoming",'xiaoming','wanlin')

效果:

huangwanlin

huangwanlin

SELECT SUBSTRING("huangwanlin",6,10)

效果:

wanlin

-----------------------------------------------------------------------------
05-28 00:02