# Select statement - Compound column data

**URL:** <https://forum.kx.com/t/select-statement-compound-column-data/7748>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [June 1, 2012, 10:10am UTC](https://forum.kx.com/t/select-statement-compound-column-data/7748 "2012-06-01T10:10:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Q\_dev](https://avatars.discourse-cdn.com/v4/letter/q/9dc877/32.png) [@Q\_dev](https://forum.kx.com/u/Q_dev)\
**Post date:** [June 1, 2012, 10:10am UTC](https://forum.kx.com/t/select-statement-compound-column-data/7748/1 "2012-06-01T10:10:00Z")

</div>

Hi ,

I have defined a table pv:( a:10 20 30; b:(`a`b;`c`d`e;`c))

Now I want to write a select statement to give the column a where each b contains `c.

i.e the?result should be

a

- 

20

30

?

Thanks in advance

?

Regrds,

Saritha

?

?

?

---

<div class="post-metadata">

**Author:** ![Kevin\_Smyth](https://avatars.discourse-cdn.com/v4/letter/k/958977/32.png) [@Kevin\_Smyth](https://forum.kx.com/u/Kevin_Smyth)\
**Post date:** [June 1, 2012, 10:13am UTC](https://forum.kx.com/t/select-statement-compound-column-data/7748/2 "2012-06-01T10:13:00Z")

</div>

select a from pv where `c in'bOn 1 June 2012 10:10, Q\_developer <qbank9> wrote:&gt; Hi ,&gt; I have defined a table pv:([] a:10 20 30; b:(`a`b;`c`d`e;`c))&gt; Now I want to write a select statement to give the column a where each b&gt; contains `c.\> i.e the?result should be\> a\> -\> 20\> 30\>\> Thanks in advance\>\> Regrds,\> Saritha\>\>\>\>\> –\>

Submitted via Google Groups

---

<div class="post-metadata">

**Author:** ![kuentang](https://avatars.discourse-cdn.com/v4/letter/k/bc8723/32.png) [@kuentang](https://forum.kx.com/u/kuentang)\
**Post date:** [June 1, 2012, 10:15am UTC](https://forum.kx.com/t/select-statement-compound-column-data/7748/3 "2012-06-01T10:15:00Z")

</div>

select from pv where ('c in) each b

correct the symbol c.

Hth

Kim

Von meinem iPhone gesendet

Am 01.06.2012 um 11:10 schrieb Q\_developer \<qbank9@gmail.com\>:

> Hi ,
> 
> I have defined a table pv:( a:10 20 30; b:(`a`b;`c`d`e;`c))
> 
> Now I want to write a select statement to give the column a where each b contains `c.
> 
> i.e the&nbsp;result should be
> 
> a
> 
> - 
> 
> 20
> 
> 30
> 
> &nbsp;
> 
> Thanks in advance
> 
> &nbsp;
> 
> Regrds,
> 
> Saritha
> 
> &nbsp;
> 
> &nbsp;
> 
> &nbsp;
> 
> –  
> Submitted via Google Groups

---

<div class="post-metadata">

**Author:** ![Attila](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@Attila](https://forum.kx.com/u/Attila)\
**Post date:** [June 1, 2012, 6:13pm UTC](https://forum.kx.com/t/select-statement-compound-column-data/7748/4 "2012-06-01T18:13:00Z")

</div>

you can hold down ’ to get `

Cheers,

&nbsp; Attila

---

<div class="post-metadata">

**Author:** ![kuentang](https://avatars.discourse-cdn.com/v4/letter/k/bc8723/32.png) [@kuentang](https://forum.kx.com/u/kuentang)\
**Post date:** [June 1, 2012, 8:52pm UTC](https://forum.kx.com/t/select-statement-compound-column-data/7748/5 "2012-06-01T20:52:00Z")

</div>

Am 01.06.2012 19:13, schrieb Attila Vrabecz:

> you can hold down ’ to get `

It works on my iphone, thx.

Kim

> Cheers,
> 
> &nbsp; Attila
