same column name in q

Can we have two column with same name in q.

To: personal-kdbplus@googlegroups.com
X-Mailer: Apple Mail (2.1257)

in a table? it would not make sense but you can force it if you want.

yes, but it’s not a good idea to do so.

Behaviour is undefined for dictionaries with non-unique keys.

then what will be the result of the below query:

tab: (a:2 3;b:11b;a:4 5)``
select a from tab;

means that the given expression flip ab`c!(2 3;1 1;4 5) will not execute?

sorry? , flip ab`a!(2 3;1 1;4 5) will not execute?

well, if you have a kdb+ console, you can try it ;-)

undefined behaviour does not mean will not execute.

q)tab:(a:2 3;c:11b;a:4 5)
q)show tab
a c a1

2 1 4
3 1 5

q)ac`a xcol tab
a c a

2 1 4
3 1 5
q)select a from tab
a

2
3

q)t: ac`a xcol tab
q)show t
a c a

2 1 4
3 1 5
q)select a from t
a

2
3

why it is not returning second a column, if i want both a column then what we need to do?

Maybe I was not clear enough.

Operations on dictionaries with non-unique keys (and hence tables with non-unque column names) result in undefined behaviour.

If you want defined behaviour, use unique names/keys.