# Keyed Table Mechanics

**URL:** <https://forum.kx.com/t/keyed-table-mechanics/13480>\
**Category:** Community Support\
**Tags:** imported, kdb-and-q\
**Created:** [March 19, 2022, 12:00am UTC](https://forum.kx.com/t/keyed-table-mechanics/13480 "2022-03-19T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptech127](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@ptech127](https://forum.kx.com/u/ptech127)\
**Post date:** [March 19, 2022, 12:00am UTC](https://forum.kx.com/t/keyed-table-mechanics/13480/1 "2022-03-19T00:00:00Z")

</div>

[https://learninghub.kx.com/forums/topic/keyed-table-mechanics](https://learninghub.kx.com/forums/topic/keyed-table-mechanics)

Why does the select function store the values of kt out of order with respect to the values of t?

---

<div class="post-metadata">

**Author:** ![pfullen1997](https://avatars.discourse-cdn.com/v4/letter/p/f08c70/32.png) [@pfullen1997](https://forum.kx.com/u/pfullen1997)\
**Post date:** [March 20, 2022, 12:00am UTC](https://forum.kx.com/t/keyed-table-mechanics/13480/2 "2022-03-20T00:00:00Z")

</div>

The values aren’t stored out of order. As the ID column is acting as a foreign key, the corresponding v values to each ID from the kt table are as follows:

```
ID v
1002 200
1001 100
1003 300
1001 100
```

That’s why they appear in the order they do in the select query. Hopefully that’s clear enough.
