使用lambda表达式的子查询

时间:2014-03-05 15:52:15

标签: linq lambda

我需要lambda表达式用于以下查询。

select tb_device.lat,tb_device.lng,tb_device.speed,tb_device.trackedOn, IL.DeviceIcon, IL.speedLimit, " +
                   "IL.deviceId, IL.deviceName, tb_device.Location, tb_device.IsExist " +
                    "from( select  CONVERT (DATE, max( trackedOn)) as trackedDate , inventoryLogId as InventoryId from tb_devicelog " +
                    "group by inventoryLogId) as tb " +
                    "inner join tb_devicelog as tb_device on tb.InventoryId=tb_device.inventoryLogId and " +
                    "tb.trackedDate= CONVERT (DATE, tb_device.trackedOn) " +
                    "inner join tb_inventorylog IL  on tb_device.inventorylogid=IL.id  " +
                    "inner join tb_Logins ln on IL.assignedToCustId = ln.customers_id where ln.userName = 'cadmin'  and IL.id in(1,3,2 )"

1 个答案:

答案 0 :(得分:0)

您可以尝试Linqer,这是一个SQL到LINQ转换器:

http://www.sqltolinq.com/