开发者_开发技巧as topic says, I don't want to return the first two letters in the return values just an example: select companyname from companies returns companyX
Can I write a query that returns panyX instead?
Thanks in advance
select right(companyname, len(companyname)-3) as companyname
will do the thing (this should work for microsoft T-SQ, see more string functions here )
Since you don't say what RDBMS you're using, here is an ANSI-compliant answer:
SELECT SUBSTRING(mycolumn,3,CHARACTER_LENGTH(mycolumn))
SELECT SUBSTRING(companyname, 3, len(companyname) - 2) FROM companies
Here is a bunch of string manipulation stuff for sql
Tutorial 4: SQL functions
SELECT SUBSTR(COMPANYNAME,3) FROM COMPANIES;
u can solve ur issue using following queries,
--> select substring([image],4,len([image]))from dbo.emp
--> select replace([image],'ima','') from dbo.emp
Thanks
Venkat
精彩评论