# Double comma when converting qsql statements to functional statements

**URL:** <https://forum.kx.com/t/double-comma-when-converting-qsql-statements-to-functional-statements/13505>\
**Category:** Community Support\
**Tags:** imported, kdb-and-q\
**Created:** [January 11, 2022, 12:00am UTC](https://forum.kx.com/t/double-comma-when-converting-qsql-statements-to-functional-statements/13505 "2022-01-11T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmcalister](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@mmcalister](https://forum.kx.com/u/mmcalister)\
**Post date:** [January 11, 2022, 12:00am UTC](https://forum.kx.com/t/double-comma-when-converting-qsql-statements-to-functional-statements/13505/1 "2022-01-11T00:00:00Z")

</div>

[https://learninghub.kx.com/forums/topic/double-comma-when-converting-qsql-statements-to-functional-statements](https://learninghub.kx.com/forums/topic/double-comma-when-converting-qsql-statements-to-functional-statements)

What does the presence of the double comma, (,) before the where phrase part of a parsed select statement.

I know a single comma means it is enlisted

What are the implications in terms of converting to a functional statement

---

<div class="post-metadata">

**Author:** ![jason\_fealy](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jason\_fealy](https://forum.kx.com/u/jason_fealy)\
**Post date:** [January 11, 2022, 12:00am UTC](https://forum.kx.com/t/double-comma-when-converting-qsql-statements-to-functional-statements/13505/2 "2022-01-11T00:00:00Z")

</div>

The list of constraints (index 2) is itself a parse tree which means value cannot be applied to the output of parse. For a simple example like this, it’s just a matter of removing a level of nesting but just to illustrate…

```
q)show t:([]a:1 2;b:10 20); 
a b 
---- 
1 10 2 20 
q)show pt:parse"select from t where a>1"; 
// parse tree at index 2 
? `t ,,(>;`a;1) 0b () 
q)value pt // value cannot be applied 
'type [0] value pt // value cannot be applied ^ 
q)@[pt;2;eval] // evalute the parse tree at index 2 which removes a level of nesting 
? `t ,(>;`a;1) 0b () 
q) 
q)value @[pt;2;eval] // value can be applied to output 
a b 
---- 
2 20 
q) 
q)?[t;enlist(>;`a;1);0b;()] ~ value @[pt;2;eval] 
// matches manually typed functional form 1b
```

&nbsp;

Some further reading which includes more complex examples [https://code.kx.com/q/wp/parse-trees/](https://code.kx.com/q/wp/parse-trees/")

&nbsp;
