Null last in order by in Mem SQL

Can someone help me how to use Null last in Mem sqlMEM, in RDBMS we have option for null last but in Mem SQL it does not supports

SingleStore supports it:

singlestore> create table t(a int);
Query OK, 0 rows affected (0.02 sec)

singlestore> insert t values(1),(2),(null),(4);

singlestore> select a from t order by a;
+------+
| a    |
+------+
| NULL |
|    1 |
|    2 |
|    4 |
+------+
4 rows in set (0.03 sec)

singlestore> select a from t order by a NULLS LAST;
+------+
| a    |
+------+
|    1 |
|    2 |
|    4 |
| NULL |
+------+

singlestore> select @@memsql_version;
+------------------+
| @@memsql_version |
+------------------+
| 7.8.9            |
+------------------+

It also works in window functions, e.g.:

select a, rank() over (order by a nulls last) from t;
+------+-------------------------------------+
| a    | rank() over (order by a nulls last) |
+------+-------------------------------------+
|    1 |                                   1 |
|    2 |                                   2 |
|    4 |                                   3 |
| NULL |                                   4 |
+------+-------------------------------------+
1 Like