substr的用法

  select substr('xfsdfsd',0) from dual; --取后面全部
  select substr('xfsdfsd',1) from dual; --取后面全部
  select substr('xfsdfsd',2) from dual; --记住是2,取第一个后面全部
  select substr('xfsdfsd',3) from dual ; 
  
  select substr('This is a test', 6, 2) 	from dual;-- return 'is'
  select substr('This is a test', 6)    	from dual;-- return 'is a test'
  select substr('TechOnTheNet', 1, 4)       from dual;-- return 'Tech'
  select substr('TechOnTheNet', -3, 3)     from dual;-- return 'Net'
  select substr('TechOnTheNet', -6, 3)     from dual;-- return 'The'
  select substr('TechOnTheNet', -8, 2)     from dual;-- return 'On'

 

你可能感兴趣的:(.net)