Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有表 REG,我想从 3 个最新字段(mood)值中计算平均值。我使用这个 sql,但这是错误的。
mood
select AVG(mood) AS sent from reg ORDER BY mood DESC LIMIT 3
尝试在子查询中预先选择您想要的值,然后对它们进行平均(假设您使用的是使用Limit关键字的 DBMS):
Limit
Select Avg(tmp.Mood) From (Select Mood From reg order by CreateDate ASC Limit 3) as tmp
我试图弄清楚如何使用 XSL 按价格对目录的 XML 列表进行排序。现在它只显示来自 XML 的正确信息。如果我使用以下代码。
<xsl:template match="catalog"> <h