Alasql: Add RIGHT() and LEFT() SQL string functions

Created on 5 Feb 2016  路  2Comments  路  Source: agershun/alasql

Add RIGHT() and LEFT() string functions from SQL

_Spawned from #588_

! Feature request Good first issue Help wanted SQL compliance

Most helpful comment

+1

All 2 comments

+1

Presumably these functions only work on varchars and it throws an error if the length supplied is greater than the length of the returned value....

ie

create table myTable (id int, name varchar(10))

insert into myTable (id, name) values (1,'test')

select left(name,3) from myTable returns 'tes'
select right(name,3) from myTable returns 'est'
select left(name,5) throws error
select right(name,5) throws error
select left(name,0) throws error
select right(name,0) throws error

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cscan picture cscan  路  4Comments

mwhebert picture mwhebert  路  3Comments

DickSwart picture DickSwart  路  6Comments

umasudhan picture umasudhan  路  4Comments

mathiasrw picture mathiasrw  路  5Comments