我想加入以下三个SQL Server表,如图所示。我知道他们必须template.html
,但是我认为正是{% if AssocAuthDomains or AssocNotAuthDomains %}
<div class="acctDomains">
<h3 class="Titles"><img src="{% static "img/templated/acct/AuthDomainSm.png" %}" width="22" height="22" alt="Authorized Domain(s)" /> Verified Domains</h3>
<ul>
{% for authdomain in AssocAuthDomains %}
<li>{{ authdomain }}<span><a class="scan" href="/Account/PerformScan/?d={{ authdomain }}">Scan now</span></a></li>
{% endfor %}
</ul>
<h3 class="Titles"><img src="{% static "img/templated/acct/UnAuthDomain.png" %}" width="22" height="22" alt="Unverified Domain(s):" /> Unverified Domains</h3>
<ul>
{% for notauthdomain in AssocNotAuthDomains %}
<li>{{ notauthdomain }}<span><a class="scan" href="Verify Now">Verify now</span></a></li>
{% endfor %}
</ul>
</div><!--acctDomains-->
才使我失望。我认为它需要Tld object (1)
Tld object (2)
中的websiteabc.com
吗?
JOIN
答案 0 :(得分:1)
您可以简单地JOIN
前两个表,然后将聚合查询转换为子查询,您也可以JOIN
:
SELECT
ActJobs.ID as JobID,
ActJobs.JobName,
ActJobs.CustomerID,
CONCAT(Cus.LastName, ', ', Cus.FirstName) as Customer,
Est.Price
FROM
Job.ActiveJobsTbl AS ActJobs
INNER JOIN Customer.CustomerTbl AS Cus ON Cus.ID = ActJobs.CustomerID
INNER JOIN (
SELECT ID_Job, SUM(ItemAmount + SalesTax) As Price
FROM Job.EstimateTbl
GROUP BY ID_Job
) AS Est ON Est.ID_Job = ActJobs.ID
答案 1 :(得分:0)
使用标量子查询并加入
// utils.js
module.exports={
print:function(){console.log('print called')}
}