M
Matthijs de Z
Hi,
could someone help me out with a conversion from SQL to Linq code.
normally I use a MySQL database and query a table with this SQL query:
select DatesInstr1.myDate,DatesInstr1.NormPrice as
PriceInstr1,DatesInstr2.NormPrice as PriceInstr2,
(DatesInstr1.NormPrice/DatesInstr2.NormPrice) as Ratio
from (select * from rsdata.normalizeddata where instrID=1)
DatesInstr1
join (select * from rsdata.normalizeddata where instrID=2)
DatesInstr2
on DatesInstr1.myDate=DatesInstr2.myDate
uses columns are difined as followed:
`myDate` int(8) not null
`instrID` int(11) not null
`NormPrice` double(12,5)
I now have the same table available in C# as a datatable (contains
some more columns then those used here) and I would like to query the
datatable to get the same result / output (including column names
etc).
So far, I wasn't able to get it working at all.
It would be great if someone could shed his/hers light on it.
kind regards,
Matthijs
could someone help me out with a conversion from SQL to Linq code.
normally I use a MySQL database and query a table with this SQL query:
select DatesInstr1.myDate,DatesInstr1.NormPrice as
PriceInstr1,DatesInstr2.NormPrice as PriceInstr2,
(DatesInstr1.NormPrice/DatesInstr2.NormPrice) as Ratio
from (select * from rsdata.normalizeddata where instrID=1)
DatesInstr1
join (select * from rsdata.normalizeddata where instrID=2)
DatesInstr2
on DatesInstr1.myDate=DatesInstr2.myDate
uses columns are difined as followed:
`myDate` int(8) not null
`instrID` int(11) not null
`NormPrice` double(12,5)
I now have the same table available in C# as a datatable (contains
some more columns then those used here) and I would like to query the
datatable to get the same result / output (including column names
etc).
So far, I wasn't able to get it working at all.
It would be great if someone could shed his/hers light on it.
kind regards,
Matthijs