在这个人的内表面上敲我的头:
<table class="magic">
<tbody>
<!-- previous sections here -->
<!-- uninteresting section example begin -->
<tr class="head">
<th colspan="2">Spain</th>
</tr>
<!-- ... -->
<tr class="section-break"></tr>
<!-- uninteresting section example end -->
<!-- begin interesting section (position not fixed) -->
<tr class="head">
<th colspan="2">United States</th>
</tr>
<tr></tr> <!-- match here begin (length not fixed) -->
<tr></tr>
<!-- ... -->
<tr></tr> <!-- match here end -->
<tr class="section-break"></tr>
<!-- end interesting section -->
<!-- next sections -->
<!-- ... -->
<tr class="section-break"></tr>
<!-- ... -->
<tr class="section-break"></tr>
<!-- ... -->
</tbody>
<table>
到目前为止:
/table[@class="magic"]/tbody/tr[following-sibling::tr/th[text()="United States"] and preceding-sibling::tr[contains(@class,"section-break")][12345]]
^--- evil magic constant 12345: must not be hard-coded, probably some sort of `count()`constraint or Kayessian ?
但如何找到section-break
之后的第一个United States
?
答案 0 :(得分:1)
SELECT STUDENT, AVG( NOT_NOT*1.0 )
FROM NOTAS
WHERE FECH_NOT >= '2003-01-01' AND FECH_NOT < '2004-01-01'
GROUP BY STUDENT;