[ 
https://issues.apache.org/jira/browse/CALCITE-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16838347#comment-16838347
 ] 

pingle wang commented on CALCITE-2601:
--------------------------------------

[~julianhyde]  mysql, sql server, hive, postgresql, oracle also use REVERSE 
function.

mysql

```sql
mysql> SELECT REVERSE('abcd'); 
+---------------------------------------------------------+ | REVERSE('abcd') | 
+---------------------------------------------------------+ | dcba | 
+---------------------------------------------------------+ 1 row in set (0.00 
sec)
```

sql server

```

DECLARE @str NVARCHAR(100) 

SET @str='ABCD'

SELECT REVERSE(@str)

```

pg

```
testdb=# SELECT REVERSE('abcd'); reverse--------- dcba(1 row)  
```

oracle

```

SQL> select reverse('12345') from dual;
REVER
-----
54321

```

doc:

[https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_reverse]

[https://docs.microsoft.com/en-us/sql/integration-services/expressions/reverse-ssis-expression?view=sql-server-2017]

 

 

 

> Support REVERSE(str) in SqlFunctions
> ------------------------------------
>
>                 Key: CALCITE-2601
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2601
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: TANG Wen-hui
>            Priority: Major
>
> Returns the string _{{str}}_ with the order of the characters reversed.
> I think ’Reverse‘ seems to be a generic function.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to