about aj

q) table1:(a:(1 1 3 1);b:(4 5 4 4);d:(7 8 9 6)) 

q) table2:(a:(1 2 3);b:(4 5 6);c:(7 8 9))

q) show aj[ab;table1;table2]

q)table1

a b d


1 4 7

1 5 8

3 4 9

1 4 6

q)table2

a b c


1 4 7

2 5 8

3 6 9

q)show aj[ab;table1;table2]

a b d c


1 4 7 7

1 5 8 7

3 4 9

1 4 6 7

WHY NOT??

q)show aj[ab;table1;table2]

a b d c


1 4 7 7

1 5 8

3 4 9

1 4 6 7

according to ?1 5? in table1, there is not matching records in table2.

Yes, it is doing the asof lookup on the b column

If you want a left join

q)table1 lj 2!table2

a b d c


1 4 7 7

1 5 8

3 4 9

1 4 6 7

Cheers,

  Attila

  Attila

Attila,

q) show aj[ab;table1;table2]

which means lookup on a column and b column ?

exact lookup on column a
asof (on or before) lookup on column b

http://code.kx.com/wiki/Reference/aj

Cheers,

  Attila

  Attila

Have a try:
show table2 asof ab!(1;5) , you’ll got it.

Here, column b is correspond to a time column.