Received: by 10.100.91.18 with SMTP id o18mr231104anb.29.1247149657829; Thu, 09 Jul 2009 07:27:37 -0700 (PDT)Date: Thu, 9 Jul 2009 07:27:37 -0700 (PDT)X-IP: 204.152.180.10User-Agent: G2/1.0X-Google-Token: rT5xXAwAAADlSdr7Al-MAfPx1bchDsGXX-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1,gzip(gfe),gzip(gfe)X-HTTP-Via: 1.1 webwasher (Webwasher 6.8.3.4533)Message-ID: Subject: How to combine two tablesFrom: Iris <fanny_fx>To: “Kdb+ Personal Developers” X-Google-Approved: charlie@kx.com via web at 2009-07-09 14:32:12I have two tables:table1: sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_sizetable2:
symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exsI want to combine two tables into one table; each record would besym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size
Bid_exsthe currrent two tables are perfectly corresponding …the ith line in table1 is for ith line in table 2i know there should be a simple way to do that and try to use lj, uj,but do not work…anyone can help? thanks!</fanny_fx>
In-Reply-To:
Sensitivity: Normal
Importance: Normal
Subject: Re: [personal kdb+] How to combine two tables
To: personal-kdbplus@googlegroups.com
From: “Manish Patel” <manni.patel>
Date: Thu, 9 Jul 2009 14:38:55 +0000
SWYgaXRzIHJvdyBmb3Igcm93LCB5b3UgY2FuIHVzZSBqb2luLWVhY2gNCg0KYSwnYg0KDQpTZW50
IHVzaW5nIEJsYWNrQmVycnmuIGZyb20gT3JhbmdlDQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0t
LS0tDQpGcm9tOiBJcmlzIDxmYW5ueV9meEBtc24uY29tPg0KDQpEYXRlOiBUaHUsIDkgSnVsIDIw
MDkgMDc6Mjc6MzcgDQpUbzogS2RiKyBQZXJzb25hbCBEZXZlbG9wZXJzPHBlcnNvbmFsLWtkYnBs
dXNAZ29vZ2xlZ3JvdXBzLmNvbT4NClN1YmplY3Q6IFtwZXJzb25hbCBrZGIrXSBIb3cgdG8gY29t
YmluZSB0d28gdGFibGVzDQoNCg0KDQpJIGhhdmUgdHdvIHRhYmxlczoNCg0KdGFibGUxOiBgc3lt
YGV4cF9tb250aGBleHBfeWVhcmBzdHJpa2VfY29kZWBzdHJpa2VgQVZHX1NwcmVhZGBCaWRfc2l6
ZQ0KDQp0YWJsZTI6IGBzeW1gZXhwX21vbnRoYGV4cF95ZWFyYHN0cmlrZV9jb2RlYHN0cmlrZWBB
VkdfU3ByZWFkYEJpZF9leHMNCg0KSSB3YW50IHRvIGNvbWJpbmUgdHdvIHRhYmxlcyBpbnRvIG9u
ZSB0YWJsZTsgZWFjaCByZWNvcmQgd291bGQgYmUNCg0KYHN5bWBleHBfbW9udGhgZXhwX3llYXJg
c3RyaWtlX2NvZGVgc3RyaWtlYEFWR19TcHJlYWRgQmlkX3NpemVgQmlkX2V4cw0KDQp0aGUgY3Vy
cnJlbnQgdHdvIHRhYmxlcyBhcmUgcGVyZmVjdGx5IGNvcnJlc3BvbmRpbmcgLi4uDQp0aGUgaXRo
IGxpbmUgaW4gdGFibGUxIGlzIGZvciBpdGggbGluZSBpbiB0YWJsZSAyDQoNCmkga25vdyB0aGVy
ZSBzaG91bGQgYmUgYSBzaW1wbGUgd2F5IHRvIGRvIHRoYXQgYW5kIHRyeSB0byB1c2UgbGosIHVq
LA0KYnV0IGRvIG5vdCB3b3JrLi4uDQoNCmFueW9uZSBjYW4gaGVscD8gdGhhbmtzIQ0KDQoNCg==
</manni.patel>
it does not work…On Jul 9, 9:38 am, “Manish Patel” <manni.pa…> wrote:> If its row for row, you can use join-each>> a,'b>> Sent using BlackBerry? from Orange>> -----Original Message-----> From: Iris <fanny…>>> Date: Thu, 9 Jul 2009 07:27:37> To: Kdb+ Personal Developers> Subject: [personal kdb+] How to combine two tables>> I have two tables:>> table1: sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size>> table2:
symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exs>> I want to combine two tables into one table; each record would be>> sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size
Bid_exs>> the currrent two tables are perfectly corresponding …> the ith line in table1 is for ith line in table 2>> i know there should be a simple way to do that and try to use lj, uj,> but do not work…>> anyone can help? thanks!</fanny…></manni.pa…>
In-Reply-To: <64770472-bc90-47ce-9688-42d135a9277f@j9g2000prh.googlegroups.com>
Sensitivity: Normal
Importance: Normal
Subject: Re: [personal kdb+] Re: How to combine two tables
To: personal-kdbplus@googlegroups.com
From: “Manish Patel” <manni.patel>
Date: Thu, 9 Jul 2009 17:30:34 +0000
S2V5IHRoZSBjb21tb24gY29sdW1ucyBhbmQgdWogdGhlIHRhYmxlcyAtIGVnIGlmIHRoZSBmaXJz
dCAyIGNvbHMgYXJlIGNvbW1vbiBiZXR3ZWVuIHRoZSB0YWJsZXMgdGhlbjoNCg0KKDIhYSkgdWog
KDIhYikNCg0KU2hvdWxkIHdvcmsNCg0KU29ycnksIGpvaW4gZWFjaCB3b3VsZCBoYXZlIHdvcmtl
ZCBmb3IgPXJvdyBjb3VudHMgYW5kIGRpZmZlcmVudCBjb2xzDQoNCg0KU2VudCB1c2luZyBCbGFj
a0JlcnJ5riBmcm9tIE9yYW5nZQ0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTog
SXJpcyA8ZmFubnlfZnhAbXNuLmNvbT4NCg0KRGF0ZTogVGh1LCA5IEp1bCAyMDA5IDEwOjA2OjAw
IA0KVG86IEtkYisgUGVyc29uYWwgRGV2ZWxvcGVyczxwZXJzb25hbC1rZGJwbHVzQGdvb2dsZWdy
b3Vwcy5jb20+DQpTdWJqZWN0OiBbcGVyc29uYWwga2RiK10gUmU6IEhvdyB0byBjb21iaW5lIHR3
byB0YWJsZXMNCg0KDQoNCml0IGRvZXMgbm90IHdvcmsuLi4uDQoNCk9uIEp1bCA5LCA5OjM4IGFt
LCAiTWFuaXNoIFBhd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SAyDQo+DQo+IGkga25vdyB0aGVyZSBzaG91bGQgYmUgYSBzaW1wbGUgd2F5IHRv
IGRvIHRoYXQgYW5kIHRyeSB0byB1c2UgbGosIHVqLA0KPiBidXQgZG8gbm90IHdvcmsuLi4NCj4N
Cj4gYW55b25lIGNhbiBoZWxwPyB0aGFua3MhDQoNCg==
</manni.patel>
Sorry. maybe I confuse you.in table 1symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_sizeand table 2symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exsboth of them have multiple records for the samesym,exp_month,exp_year,strike_code,strike,AVG_Spread,So uj can work normally but it does not work in my scenarioWhat i want to do:add a new column in the table 1 to include Bid_exs column;assign the Bid_exs column from table 2 to table 1 directly…any quick methods for that??On Jul 9, 12:30 pm, “Manish Patel” <manni.pa…> wrote:> Key the common columns and uj the tables - eg if the first 2 cols are common between the tables then:>> (2!a) uj (2!b)>> Should work>> Sorry, join each would have worked for =row counts and different cols>> Sent using BlackBerry? from Orange>> -----Original Message-----> From: Iris <fanny…>>> Date: Thu, 9 Jul 2009 10:06:00> To: Kdb+ Personal Developers> Subject: [personal kdb+] Re: How to combine two tables>> it does not work…>> On Jul 9, 9:38 am, “Manish Patel” <manni.pa…> wrote:> > If its row for row, you can use join-each>> > a,'b>> > Sent using BlackBerry? from Orange>> > -----Original Message-----> > From: Iris <fanny…>>> > Date: Thu, 9 Jul 2009 07:27:37> > To: Kdb+ Personal Developers> > Subject: [personal kdb+] How to combine two tables>> > I have two tables:>> > table1: sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size>> > table2:
symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exs>> > I want to combine two tables into one table; each record would be>> > sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size
Bid_exs>> > the currrent two tables are perfectly corresponding …> > the ith line in table1 is for ith line in table 2>> > i know there should be a simple way to do that and try to use lj, uj,> > but do not work…>> > anyone can help? thanks!</fanny…></manni.pa…></fanny…></manni.pa…>
and the problem is just to how to assign values to a column in a tablein one time?Since I query huge data, i wonder any quick methods…thanks!!!On Jul 9, 1:03 pm, Iris <fanny…> wrote:> Sorry. maybe I confuse you.>> in table 1> symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_size>> and table 2> symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exs>> both of them have multiple records for the same> sym,exp_month,exp_year,strike_code,strike,AVG_Spread,>> So uj can work normally but it does not work in my scenario>> What i want to do:> add a new column in the table 1 to include Bid_exs column;> assign the Bid_exs column from table 2 to table 1 directly…>> any quick methods for that??>> On Jul 9, 12:30 pm, “Manish Patel” <manni.pa…> wrote:>> > Key the common columns and uj the tables - eg if the first 2 cols are common between the tables then:>> > (2!a) uj (2!b)>> > Should work>> > Sorry, join each would have worked for =row counts and different cols>> > Sent using BlackBerry? from Orange>> > -----Original Message-----> > From: Iris <fanny…>>> > Date: Thu, 9 Jul 2009 10:06:00> > To: Kdb+ Personal Developers> > Subject: [personal kdb+] Re: How to combine two tables>> > it does not work…>> > On Jul 9, 9:38 am, “Manish Patel” <manni.pa…> wrote:> > > If its row for row, you can use join-each>> > > a,'b>> > > Sent using BlackBerry? from Orange>> > > -----Original Message-----> > > From: Iris <fanny…>>> > > Date: Thu, 9 Jul 2009 07:27:37> > > To: Kdb+ Personal Developers> > > Subject: [personal kdb+] How to combine two tables>> > > I have two tables:>> > > table1: sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size>> > > table2:
symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exs>> > > I want to combine two tables into one table; each record would be>> > > sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size
Bid_exs>> > > the currrent two tables are perfectly corresponding …> > > the ith line in table1 is for ith line in table 2>> > > i know there should be a simple way to do that and try to use lj, uj,> > > but do not work…>> > > anyone can help? thanks!</fanny…></manni.pa…></fanny…></manni.pa…></fanny…>
Date: Thu, 9 Jul 2009 14:25:23 -0400Message-ID: <1855e77f0907091125i1f235a36jc876f7f60c96ece0@mail.gmail.com>Subject: Re: [personal kdb+] Re: How to combine two tablesFrom: Attila Vrabecz <attila.vrabecz>To: personal-kdbplus@googlegroups.comif both tables are non-keyedtable1.Bid_exs:table2.Bid_excs AttilaOn Thu, Jul 9, 2009 at 2:09 PM, Iris<fanny_fx> wrote:>> and the problem is just to how to assign values to a column in a table> in one time?> Since I query huge data, i wonder any quick methods…> thanks!!!>> On Jul 9, 1:03 pm, Iris <fanny…> wrote:>> Sorry. maybe I confuse you.>>>> in table 1>> symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_size>>>> and table 2>> symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exs>>>> both of them have multiple records for the same>> sym,exp_month,exp_year,strike_code,strike,AVG_Spread,>>>> So uj can work normally but it does not work in my scenario>>>> What i want to do:>> add a new column in the table 1 to include Bid_exs column;>> assign the Bid_exs column from table 2 to table 1 directly…>>>> any quick methods for that??>>>> On Jul 9, 12:30 pm, “Manish Patel” <manni.pa…> wrote:>>>> > Key the common columns and uj the tables - eg if the first 2 cols are common between the tables then:>>>> > (2!a) uj (2!b)>>>> > Should work>>>> > Sorry, join each would have worked for =row counts and different cols>>>> > Sent using BlackBerry? from Orange>>>> > -----Original Message----->> > From: Iris <fanny…>>>>> > Date: Thu, 9 Jul 2009 10:06:00>> > To: Kdb+ Personal Developers>> > Subject: [personal kdb+] Re: How to combine two tables>>>> > it does not work…>>>> > On Jul 9, 9:38 am, “Manish Patel” <manni.pa…> wrote:>> > > If its row for row, you can use join-each>>>> > > a,'b>>>> > > Sent using BlackBerry? from Orange>>>> > > -----Original Message----->> > > From: Iris <fanny…>>>>> > > Date: Thu, 9 Jul 2009 07:27:37>> > > To: Kdb+ Personal Developers>> > > Subject: [personal kdb+] How to combine two tables>>>> > > I have two tables:>>>> > > table1: sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size>>>> > > table2:
symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exs>>>> > > I want to combine two tables into one table; each record would be>>>> > > sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size
Bid_exs>>>> > > the currrent two tables are perfectly corresponding …>> > > the ith line in table1 is for ith line in table 2>>>> > > i know there should be a simple way to do that and try to use lj, uj,>> > > but do not work…>>>> > > anyone can help? thanks!> >></fanny…></manni.pa…></fanny…></manni.pa…></fanny…></fanny_fx></attila.vrabecz>
it works fine!terrific!!!On Jul 9, 1:25 pm, Attila Vrabecz <attila.vrab…> wrote:> if both tables are non-keyed> table1.Bid_exs:table2.Bid_excs> Attila>> On Thu, Jul 9, 2009 at 2:09 PM, Iris<fanny…> wrote:>> > and the problem is just to how to assign values to a column in a table> > in one time?> > Since I query huge data, i wonder any quick methods…> > thanks!!!>> > On Jul 9, 1:03 pm, Iris <fanny…> wrote:> >> Sorry. maybe I confuse you.>> >> in table 1> >> symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_size>> >> and table 2> >> symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exs>> >> both of them have multiple records for the same> >> sym,exp_month,exp_year,strike_code,strike,AVG_Spread,>> >> So uj can work normally but it does not work in my scenario>> >> What i want to do:> >> add a new column in the table 1 to include Bid_exs column;> >> assign the Bid_exs column from table 2 to table 1 directly…>> >> any quick methods for that??>> >> On Jul 9, 12:30 pm, “Manish Patel” <manni.pa…> wrote:>> >> > Key the common columns and uj the tables - eg if the first 2 cols are common between the tables then:>> >> > (2!a) uj (2!b)>> >> > Should work>> >> > Sorry, join each would have worked for =row counts and different cols>> >> > Sent using BlackBerry? from Orange>> >> > -----Original Message-----> >> > From: Iris <fanny…>>> >> > Date: Thu, 9 Jul 2009 10:06:00> >> > To: Kdb+ Personal Developers> >> > Subject: [personal kdb+] Re: How to combine two tables>> >> > it does not work…>> >> > On Jul 9, 9:38 am, “Manish Patel” <manni.pa…> wrote:> >> > > If its row for row, you can use join-each>> >> > > a,'b>> >> > > Sent using BlackBerry? from Orange>> >> > > -----Original Message-----> >> > > From: Iris <fanny…>>> >> > > Date: Thu, 9 Jul 2009 07:27:37> >> > > To: Kdb+ Personal Developers> >> > > Subject: [personal kdb+] How to combine two tables>> >> > > I have two tables:>> >> > > table1: sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size>> >> > > table2:
symexp_month
exp_yearstrike_code
strikeAVG_Spread
Bid_exs>> >> > > I want to combine two tables into one table; each record would be>> >> > > sym
exp_monthexp_year
strike_codestrike
AVG_SpreadBid_size
Bid_exs>> >> > > the currrent two tables are perfectly corresponding …> >> > > the ith line in table1 is for ith line in table 2>> >> > > i know there should be a simple way to do that and try to use lj, uj,> >> > > but do not work…>> >> > > anyone can help? thanks!</fanny…></manni.pa…></fanny…></manni.pa…></fanny…></fanny…></attila.vrab…>