cnblogs/dcrenl/LINQ查询.html

718 lines
123 KiB
HTML
Raw Normal View History

2024-09-24 12:43:01 +08:00
<div id="sina_keyword_ad_area2" class="articalContent ">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span lang="EN-US">select</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询顾客的公司名、地址信息</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">构建匿名类型</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">1=&nbsp;<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">公司名</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= c.CompanyName,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">地址</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= c.Address</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t0].[CompanyName],[t0].[Address]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Customers] AS[t0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询职员的姓名和雇用年份</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">构建匿名类型</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">2=&nbsp;<span style="color: blue;">from</span>&nbsp;emp&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Employees</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">姓名</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= emp.LastName +emp.FirstName,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">雇用年</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= emp.HireDate.Value.Year</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t0].[LastName] + [t0].[FirstName] AS[value], DATEPART(Year, [t0].[HireDate]) AS [value2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Employees] AS [t0]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询顾客的</span><span lang="EN-US">ID</span><span style="font-family: 宋体;">以及联系信息(职位和联系人)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">构建匿名类型</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">3=&nbsp;<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID= c.CustomerID,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">联系信息</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">职位</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= c.ContactTitle,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">联系人</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= c.ContactName</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t0].[CustomerID], [t0].[ContactTitle],[t0].[ContactName]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Customers] AS [t0]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询订单号和订单是否超重的信息</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;select</span><span style="font-size: 9pt; font-family: 宋体;">带条件</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">from</span>&nbsp;o&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Orders</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">订单号</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= o.OrderID,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">是否超重</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= o.Freight &gt; 100?&nbsp;<span style="color: #a31515;">"</span></span><span style="font-size: 9pt; color: #a31515; font-family: 宋体;"></span><span style="font-size: 9pt; color: #a31515; font-family: Consolas;" lang="EN-US">"</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;:&nbsp;<span style="color: #a31515;">"</span></span><span style="font-size: 9pt; color: #a31515; font-family: 宋体;"></span><span style="font-size: 9pt; color: #a31515; font-family: Consolas;" lang="EN-US">"</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t0].[OrderID],</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;(CASE</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHEN[t0].[Freight] &gt; @p0 THEN @p1</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELSE@p2</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END)AS [value]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Orders] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input Currency (Size = 0; Prec = 19; Scale= 4) [100]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p1: Input String (Size = 1; Prec = 0; Scale =0) [</span><span style="font-size: 9pt; font-family: 宋体;"></span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p2: Input String (Size = 1; Prec = 0; Scale =0) [</span><span style="font-size: 9pt; font-family: 宋体;"></span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span lang="EN-US">where</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询顾客的国家、城市和订单数信息,要求国家是法国并且订单数大于</span><span lang="EN-US">5</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">多条件</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">where</span>&nbsp;c.Country==&nbsp;<span style="color: #a31515;">"France"</span>&nbsp;&amp;&amp;c.Orders.Count &gt; 5</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">国家</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= c.Country,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">城市</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= c.City,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">订单数</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= c.Orders.Count</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t0].[Country], [t0].[City], (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTCOUNT(*)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Orders] AS [t2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;WHERE[t2].[CustomerID] = [t0].[CustomerID]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [value]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">WHERE ([t0].[Country] = @p0) AND (((</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTCOUNT(*)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Orders] AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;WHERE[t1].[CustomerID] = [t0].[CustomerID]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;))&gt; @p1)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input String (Size = 6; Prec = 0; Scale =0) [France]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p1: Input Int32 (Size = 0; Prec = 0; Scale =0)[5]&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span lang="EN-US">orderby</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询所有没有下属雇员的雇用年和名,按照雇用年倒序,按照名正序</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;<span style="color: blue;">var</span>&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">排序</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">from</span>&nbsp;emp&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Employees</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">where</span>&nbsp;emp.Employees.Count== 0</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">orderby</span>&nbsp;emp.HireDate.Value.Year&nbsp;<span style="color: blue;">descending</span>,emp.FirstName<span style="color: blue;">ascending</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">雇用年</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= emp.HireDate.Value.Year,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;"></span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= emp.FirstName</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT DATEPART(Year, [t0].[HireDate]) AS [value],[t0].[FirstName]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Employees] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">WHERE ((</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTCOUNT(*)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Employees] AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;WHERE[t1].[ReportsTo] = [t0].[EmployeeID]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;))= @p0</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">ORDER BY DATEPART(Year, [t0].[HireDate]) DESC,[t0].[FirstName]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input Int32 (Size = 0; Prec = 0; Scale =0) [0]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span style="font-family: 宋体;">分页</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:按照每页</span><span lang="EN-US">10</span><span style="font-family: 宋体;">条记录,查询第二页的顾客</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;<span style="color: blue;">var</span>&nbsp;</span><span style="font-size: 9pt; line-height: 18px; font-family: 宋体;">分页</span><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;">&nbsp;<span lang="EN-US">= (<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">select</span>&nbsp;c).Skip(10).Take(10);</span></span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT TOP 10 [t1].[CustomerID],[t1].[CompanyName], [t1].[ContactName], [t1].[ContactTitle],[t1].[Address], [t1].[City], [t1].[Region], [t1].[PostalCode],[t1].[Country], [t1].[Phone], [t1].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTROW_NUMBER() OVER (ORDER BY [t0].[CustomerID], [t0].[CompanyName],[t0].[ContactName], [t0].[ContactTitle], [t0].[Address],[t0].[City], [t0].[Region], [t0].[PostalCode], [t0].[Country],[t0].[Phone], [t0].[Fax]) AS [ROW_NUMBER], [t0].[CustomerID],[t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle],[t0].[Address], [t0].[City], [t0].[Region], [t0].[PostalCode],[t0].[Country], [t0].[Phone], [t0].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">WHERE [t1].[ROW_NUMBER] &gt;@p0</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input Int32 (Size = 0; Prec = 0; Scale =0) [10]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span style="font-family: 宋体;">分组</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:根据顾客的国家分组,查询顾客数大于</span><span lang="EN-US">5</span><span style="font-family: 宋体;">的国家名和顾客数</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">var</span>&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">一般分组</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">group</span>&nbsp;c&nbsp;<span style="color: blue;">by</span>&nbsp;c.Country&nbsp;<span style="color: blue;">into</span>&nbsp;g</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">where</span>&nbsp;g.Count()&gt; 5</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">orderby</span>&nbsp;g.Count()&nbsp;<span style="color: blue;">descending</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">国家</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= g.Key,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">顾客数</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= g.Count()</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t1].[Country], [t1].[value3] AS[</span><span style="font-size: 9pt; font-family: 宋体;">顾客数</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTCOUNT(*) AS [value], COUNT(*) AS [value2], COUNT(*) AS [value3],[t0].[Country]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;GROUPBY [t0].[Country]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">WHERE [t1].[value] &gt; @p0</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">ORDER BY [t1].[value2] DESC</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input Int32 (Size = 0; Prec = 0; Scale =0) [5]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:根据国家和城市分组,查询顾客覆盖的国家和城市</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">var</span>&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">匿名类型分组</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">group</span>&nbsp;c&nbsp;<span style="color: blue;">by</span>&nbsp;<span style="color: blue;">new</span>&nbsp;{c.City, c.Country }&nbsp;<span style="color: blue;">into</span>&nbsp;g</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">orderby</span>&nbsp;g.Key.Country,g.Key.City</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">国家</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= g.Key.Country,</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">城市</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= g.Key.City</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t1].[Country], [t1].[City]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECT[t0].[City], [t0].[Country]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;GROUPBY [t0].[City], [t0].[Country]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">ORDER BY [t1].[Country], [t1].[City]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:按照是否超重条件分组,分别查询订单数量</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">按照条件分组</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">from</span>&nbsp;o&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Orders</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">group</span>&nbsp;o&nbsp;<span style="color: blue;">by</span>&nbsp;<span style="color: blue;">new</span>&nbsp;{&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">条件</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= o.Freight &gt; 100}&nbsp;<span style="color: blue;">into</span>&nbsp;g</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;<span style="color: blue;">new</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">数量</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= g.Count(),</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">是否超重</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= g.Key.</span><span style="font-size: 9pt; font-family: 宋体;">条件</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;?&nbsp;<span style="color: #a31515;">"</span></span><span style="font-size: 9pt; color: #a31515; font-family: 宋体;"></span><span style="font-size: 9pt; color: #a31515; font-family: Consolas;" lang="EN-US">"</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;:&nbsp;<span style="color: #a31515;">"</span></span><span style="font-size: 9pt; color: #a31515; font-family: 宋体;"></span><span style="font-size: 9pt; color: #a31515; font-family: Consolas;" lang="EN-US">"</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;(CASE</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHEN[t2].[value2] = 1 THEN @p1</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELSE@p2</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END)AS [value], [t2].[value] AS [</span><span style="font-size: 9pt; font-family: 宋体;">数量</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTCOUNT(*) AS [value], [t1].[value] AS [value2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM(</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(CASE</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHEN[t0].[Freight] &gt; @p0 THEN 1</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHENNOT ([t0].[Freight] &gt; @p0) THEN 0</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELSENULL</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;END)AS [value]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Orders] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;GROUPBY [t1].[value]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [t2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input Currency (Size = 0; Prec = 19; Scale= 4) [100]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p1: Input String (Size = 1; Prec = 0; Scale =0) [</span><span style="font-size: 9pt; font-family: 宋体;"></span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p2: Input String (Size = 1; Prec = 0; Scale =0) [</span><span style="font-size: 9pt; font-family: 宋体;"></span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span lang="EN-US">distinct</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询顾客覆盖的国家</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; color: blue; line-height: 18px; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; line-height: 18px; font-family: 宋体;">过滤相同项</span><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;= (<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">orderby</span>&nbsp;c.Country&nbsp;<span style="color: blue;">select</span>c.Country).Distinct();</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT DISTINCT [t0].[Country]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Customers] AS [t0]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span lang="EN-US">union</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询城市是</span><span lang="EN-US">A</span><span style="font-family: 宋体;">打头和城市包含</span><span lang="EN-US">A</span><span style="font-family: 宋体;">的顾客并按照顾客名字排序</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">连接并且过滤相同项</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= (<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">where</span>&nbsp;c.City.Contains(<span style="color: #a31515;">"A"</span>)&nbsp;<span style="color: blue;">select</span>c).Union</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">where</span>&nbsp;c.ContactName.StartsWith(<span style="color: #a31515;">"A"</span>)&nbsp;<span style="color: blue;">select</span>c).OrderBy(c=&gt; c.ContactName);</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t3].[CustomerID], [t3].[CompanyName],[t3].[ContactName], [t3].[ContactTitle], [t3].[Address],[t3].[City], [t3].[Region], [t3].[PostalCode], [t3].[Country],[t3].[Phone], [t3].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECT[t2].[CustomerID], [t2].[CompanyName], [t2].[ContactName],[t2].[ContactTitle], [t2].[Address], [t2].[City], [t2].[Region],[t2].[PostalCode], [t2].[Country], [t2].[Phone],[t2].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM(</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT[t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName],[t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[Region],[t0].[PostalCode], [t0].[Country], [t0].[Phone],[t0].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE[t0].[City] LIKE @p0</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UNION</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT[t1].[CustomerID], [t1].[CompanyName], [t1].[ContactName],[t1].[ContactTitle], [t1].[Address], [t1].[City], [t1].[Region],[t1].[PostalCode], [t1].[Country], [t1].[Phone],[t1].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE[t1].[ContactName] LIKE @p1</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)AS [t2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [t3]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">ORDER BY [t3].[ContactName]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input String (Size = 3; Prec = 0; Scale =0) [%A%]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p1: Input String (Size = 2; Prec = 0; Scale =0) [A%]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span lang="EN-US">concat</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询城市是</span><span lang="EN-US">A</span><span style="font-family: 宋体;">打头和城市包含</span><span lang="EN-US">A</span><span style="font-family: 宋体;">的顾客并按照顾客名字排序,相同的顾客信息不会过滤</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">连接并且不过滤相同项</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= (<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">where</span>&nbsp;c.City.Contains(<span style="color: #a31515;">"A"</span>)<span style="color: blue;">select</span>&nbsp;c).Concat</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">where</span>&nbsp;c.ContactName.StartsWith(<span style="color: #a31515;">"A"</span>)&nbsp;<span style="color: blue;">select</span>c).OrderBy(c=&gt; c.ContactName);</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t3].[CustomerID], [t3].[CompanyName],[t3].[ContactName], [t3].[ContactTitle], [t3].[Address],[t3].[City], [t3].[Region], [t3].[PostalCode], [t3].[Country],[t3].[Phone], [t3].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECT[t2].[CustomerID], [t2].[CompanyName], [t2].[ContactName],[t2].[ContactTitle], [t2].[Address], [t2].[City], [t2].[Region],[t2].[PostalCode], [t2].[Country], [t2].[Phone],[t2].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM(</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT[t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName],[t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[Region],[t0].[PostalCode], [t0].[Country], [t0].[Phone],[t0].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE[t0].[City] LIKE @p0</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UNIONALL</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT[t1].[CustomerID], [t1].[CompanyName], [t1].[ContactName],[t1].[ContactTitle], [t1].[Address], [t1].[City], [t1].[Region],[t1].[PostalCode], [t1].[Country], [t1].[Phone],[t1].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE[t1].[ContactName] LIKE @p1</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)AS [t2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [t3]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">ORDER BY [t3].[ContactName]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input String (Size = 3; Prec = 0; Scale =0) [%A%]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p1: Input String (Size = 2; Prec = 0; Scale =0) [A%]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span style="font-family: 宋体;">取相交项</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询城市是</span><span lang="EN-US">A</span><span style="font-family: 宋体;">打头的顾客和城市包含</span><span lang="EN-US">A</span><span style="font-family: 宋体;">的顾客的交集,并按照顾客名字排序</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">取相交项</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= (<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">where</span>&nbsp;c.City.Contains(<span style="color: #a31515;">"A"</span>)&nbsp;<span style="color: blue;">select</span>c).Intersect</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">where</span>&nbsp;c.ContactName.StartsWith(<span style="color: #a31515;">"A"</span>)&nbsp;<span style="color: blue;">select</span>c).OrderBy(c=&gt; c.ContactName);</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t1].[CustomerID], [t1].[CompanyName],[t1].[ContactName], [t1].[ContactTitle], [t1].[Address],[t1].[City], [t1].[Region], [t1].[PostalCode], [t1].[Country],[t1].[Phone], [t1].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTDISTINCT [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName],[t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[Region],[t0].[PostalCode], [t0].[Country], [t0].[Phone],[t0].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">WHERE (EXISTS(</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTNULL AS [EMPTY]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;WHERE([t1].[CustomerID] = [t2].[CustomerID]) AND ([t2].[ContactName]LIKE @p0)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;))AND ([t1].[City] LIKE @p1)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">ORDER BY [t1].[ContactName]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input String (Size = 2; Prec = 0; Scale =0) [A%]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p1: Input String (Size = 3; Prec = 0; Scale =0) [%A%]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span style="font-family: 宋体;">排除相交项</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询城市包含</span><span lang="EN-US">A</span><span style="font-family: 宋体;">的顾客并从中删除城市以</span><span lang="EN-US">A</span><span style="font-family: 宋体;">开头的顾客,并按照顾客名字排序</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;</span><span style="font-size: 9pt; font-family: 宋体;">排除相交项</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;= (<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">where</span>&nbsp;c.City.Contains(<span style="color: #a31515;">"A"</span>)&nbsp;<span style="color: blue;">select</span>c).Except</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers&nbsp;<span style="color: blue;">where</span>&nbsp;c.ContactName.StartsWith(<span style="color: #a31515;">"A"</span>)&nbsp;<span style="color: blue;">select</span>c).OrderBy(c=&gt; c.ContactName);</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t1].[CustomerID], [t1].[CompanyName],[t1].[ContactName], [t1].[ContactTitle], [t1].[Address],[t1].[City], [t1].[Region], [t1].[PostalCode], [t1].[Country],[t1].[Phone], [t1].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM (</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTDISTINCT [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName],[t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[Region],[t0].[PostalCode], [t0].[Country], [t0].[Phone],[t0].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">WHERE (NOT (EXISTS(</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTNULL AS [EMPTY]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Customers] AS [t2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;WHERE([t1].[CustomerID] = [t2].[CustomerID]) AND ([t2].[ContactName]LIKE @p0)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)))AND ([t1].[City] LIKE @p1)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">ORDER BY [t1].[ContactName]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input String (Size = 2; Prec = 0; Scale =0) [A%]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p1: Input String (Size = 3; Prec = 0; Scale =0) [%A%]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span style="font-family: 宋体;">子查询</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询订单数超过</span><span lang="EN-US">5</span><span style="font-family: 宋体;">的顾客信息</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;子查询</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">where</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span style="color: blue;">from</span>&nbsp;o&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Orders&nbsp;<span style="color: blue;">group</span>&nbsp;o&nbsp;<span style="color: blue;">by</span>&nbsp;o.CustomerID&nbsp;<span style="color: blue;">into</span>&nbsp;o&nbsp;<span style="color: blue;">where</span>o.Count()&gt; 5&nbsp;<span style="color: blue;">select</span>&nbsp;o.Key).Contains(c.CustomerID)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;c;</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT [t0].[CustomerID], [t0].[CompanyName],[t0].[ContactName], [t0].[ContactTitle], [t0].[Address],[t0].[City], [t0].[Region], [t0].[PostalCode], [t0].[Country],[t0].[Phone], [t0].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">WHERE EXISTS(</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;SELECTNULL AS [EMPTY]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;FROM(</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECTCOUNT(*) AS [value], [t1].[CustomerID]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM[dbo].[Orders] AS [t1]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GROUPBY [t1].[CustomerID]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)AS [t2]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;WHERE([t2].[CustomerID] = [t0].[CustomerID]) AND ([t2].[value]&gt; @p0)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input Int32 (Size = 0; Prec = 0; Scale =0) [5]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span lang="EN-US">in</span><span style="font-family: 宋体;">操作</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:查询指定城市中的客户</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">var</span>&nbsp;in操作</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;=&nbsp;<span style="color: blue;">from</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Customers</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">where</span>&nbsp;<span style="color: blue;">new</span>&nbsp;<span style="color: blue;">string</span>[]{&nbsp;<span style="color: #a31515;">"Brandenburg"</span>,&nbsp;<span style="color: #a31515;">"Cowes"</span>,&nbsp;<span style="color: #a31515;">"Stavern"</span>}.Contains(c.City)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;c;</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT[t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName],[t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[Region],[t0].[PostalCode], [t0].[Country], [t0].[Phone],[t0].[Fax]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Customers] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">WHERE [t0].[City] IN (@p0, @p1, @p2)</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p0: Input String (Size = 11; Prec = 0; Scale =0) [Brandenburg]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p1: Input String (Size = 5; Prec = 0; Scale =0) [Cowes]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">-- @p2: Input String (Size = 7; Prec = 0; Scale =0) [Stavern]</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="line-height: 15px;"><span lang="EN-US">join</span></span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:内连接,没有分类的产品查询不到</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;innerjoin =&nbsp;<span style="color: blue;">from</span>&nbsp;p&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Products</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">join</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Categories</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">on</span>&nbsp;p.CategoryID&nbsp;<span style="color: blue;">equals</span>&nbsp;c.CategoryID</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;p.ProductName;</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT COUNT(*) AS [value]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Products] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">INNER JOIN [dbo].[Categories] AS [t1] ON[t0].[CategoryID] = ([t1].[CategoryID])</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">描述:外连接,没有分类的产品也能查询到</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">查询句法:</span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; color: blue; font-family: Consolas;" lang="EN-US">var</span><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;leftjoin =&nbsp;<span style="color: blue;">from</span>&nbsp;p&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Products</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">join</span>&nbsp;c&nbsp;<span style="color: blue;">in</span>&nbsp;ctx.Categories</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">on</span>&nbsp;p.CategoryID&nbsp;<span style="color: blue;">equals</span>&nbsp;c.CategoryID</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">into</span>&nbsp;pro</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">from</span>&nbsp;x&nbsp;<span style="color: blue;">in</span>&nbsp;pro.DefaultIfEmpty()</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;"><span style="font-size: 9pt; line-height: 18px; font-family: Consolas;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">select</span>&nbsp;p.ProductName;</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span style="font-family: 宋体;">对应</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;"></span></p>
<p style="margin: 10px auto; font-size: 13px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; line-height: 19px; background-color: #f5f5f5;">&nbsp;</p>
<table style="border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border: 1pt solid windowtext; border-collapse: collapse; padding: 0cm 5.4pt; word-break: normal!important; width: 426.1pt; background-color: transparent;" valign="top" width="568">
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">SELECT COUNT(*) AS [value]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">FROM [dbo].[Products] AS [t0]</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px;" align="left"><span style="font-size: 9pt; font-family: Consolas;" lang="EN-US">LEFT OUTER JOIN [dbo].[Categories] AS [t1] ON[t0].[CategoryID] = ([t1].[CategoryID])</span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family: 宋体;">你可能会很奇怪,原先很复杂的</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;">使用查询句法会很简单(比如按照条件分组)。但是原先觉得很好理解的</span><span lang="EN-US">SQL</span><span style="font-family: 宋体;">使用查询句法会觉得很复杂(比如连接查询)。其实,我们还可以通过其它方式进行连接操作,在以后说</span><span lang="EN-US"><span style="font-size: 10.5pt; font-family: 'Times new roman';" lang="EN-US">DataLoadOptions</span></span><span style="font-family: 宋体;">类型的时候会再说。虽然</span><span lang="EN-US">Linq to sql</span><span style="font-family: 宋体;">已经非常智能了,但是对于非常复杂的查询还是建议通过存储过程实现,下次讲解如何调用存储过程。</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;"> <span style="font-family: 宋体;"><br />
</span></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;">
<span style="font-family: 宋体;">本文转自:</span><a href="http://www.cnblogs.com/lovecherry/archive/2007/08/17/859826.html" target="_blank">http://www.cnblogs.com/lovecherry/archive/2007/08/17/859826.html</a></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;">
相关内容网址:<a href="http://www.cnblogs.com/lovecherry/archive/2007/08/13/853754.html" target="_blank">http://www.cnblogs.com/lovecherry/archive/2007/08/13/853754.html</a></p>
<p style="margin: 0cm 0cm 0pt; font-size: 13px; line-height: 19px; font-family: Tahoma,Verdana,Geneva,Arial,Helvetica,sans-serif; background-color: #f5f5f5;">
<br />
</p>
</div>
<p>&nbsp;</p>