Into Clause VS Let Clause
来源:互联网 发布:公众号助手电脑版 mac 编辑:程序博客网 时间:2024/06/07 04:23
1.Into Clause
用来将select, join,或者group的结果存储到一个临时变量中。
目的:在之后的查询中需要使用此结果。例如:
var developersGroupedByLanguage = from d in developers group d by d.Language into developersGrouped select new { Language = developersGrouped.Key, DevelopersCount = developersGrouped.Count() };foreach (var group in developersGroupedByLanguage) { Console.WriteLine ("Language {0} contains {1} developers", group.Language, group.DevelopersCount);}
2.Let Clause
let子句将一个子表达式的结果存储到一个变量中。
与SQL语句相比较,let子句产生的变量类似于计算列。即该列是通过对表中若干列进行某种计算获得的。例如对OrderDetail中的UnitPrice * Count得到某商品的总价。
var categoriesByProductsNumberQuery = from c in categories join p in products on c.IdCategory equals p.IdCategory into productsByCategory let ProductsCount = productsByCategory.Count() orderby ProductsCount select new { c.IdCategory, ProductsCount}; foreach (var item in categoriesByProductsNumberQuery) {Console.WriteLine(item);}
- Into Clause VS Let Clause
- DML RETURNING INTO Clause
- Oracle bulk into clause
- HAVING vs WHERE Clause
- slq clause
- MDIO Clause 22 and Clause 45
- MDIO Clause 45 和Clause 22
- MDIO Clause 45 和Clause 22
- Oracle WITH clause
- SQL: ORDER BY Clause
- SQL: HAVING Clause
- SQL: GROUP BY Clause
- The WITH Clause
- The FOR UPDATE Clause
- Returning Clause(子句)
- WITH Clause : Subquery Factoring
- where clause is ambiguous
- cypher二(clause)
- Android 仿 WP7 布局
- the different between C and C++
- AS3嵌入swf元件库,如何访问指定的资源
- 使用Ant来编译Flex应用
- Flex mxmlc编译命令选项
- Into Clause VS Let Clause
- 数组初始化 –memset or {0}
- mongodb过滤查询键值
- Eclipse常用快捷键和字体设置
- 如何在派生类中的隐藏基类的虚拟重载函数?
- 为什么要不断接触和学习新技术之我见
- java小练习之继承示例
- 原来这个是第一天。
- 利用Log parse 分析Exchange 性能并产生相应报表!(1)-Agent Log!