Substring

Ivan Smahin ivan_smahin at paradigmasoft.com
Thu Dec 11 08:52:46 CST 2014


On Dec 11, 2014, at 12:52, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:

> Hi,
> 
> I would like to get part of a string from a database field. The syntax I'd like to use is
> 
> SELECT SUBSTRING(xstring,5,2) AS ystring FROM xtable
> 
> This should get characters 5 and 6 from field xstring renamed as ystring. Is this valid Valentina SQL syntax? If not, what would be a good alternative?

SELECT SUBSTR('Valentina',6,4)
=> 'tina'

SELECT SUBSTR('Valentina',2)
=> 'alentina'

SELECT SUBSTRING('Valentina' FROM 6 FOR 4)
=> 'tina'

SELECT SUBSTRING('Valentina' FROM 2)
=> 'alentina'

http://www.valentina-db.com/docs/dokuwiki/v5/doku.php?id=valentina:vcomponents:vsql:reference:expr:funcs_string&s[]=substr#substr_str_pos_len

Also you can find an interactive help right in the Valentina Studio.

-- 
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list