help in Query needed

Hi,I have three tables.users([name:symbol$()] age:int$())stocks([sid:symbol$()] desc:symbol$();mktvalue;float$()))portfolio( name:users$();sid stocks$(),noofstocks:int$())If i want desc of stocks held by a particular user, what should be thecorrect q Query.-- Robert Ashok

Hello,

After fixing some typos & renaming desc to description (due to an assign error as desc is a function, hence reserved name):

users:([name:symbol$()] age:int$())
stocks:([sid:symbol$()] description:symbol$();mktvalue:float$()) portfolio:([] name:users$();sid:stocks$();noofstocks:int$())

The query you’re looking for is:

select sid.description from portfolio where name=`user

These types of joins are documented on?https://code.kx.com/trac/wiki/QforMortals2/tables#Foreign-Keys-and-Virtual-Columns?(user/pass:anonymous/anonymous).

Regards,

Fintan.

Thanks

Sent from my iPhone