我有一个非常复杂的查询,它获取invoicNo
唯一的表的最后一行。我想在此查询中添加一个where子句,如
WHERE bill_type LIKE '$invoice.
这是我当前的查询
Select * From (SELECT t.*, @rownum := @rownum + 1 AS rank FROM
selected_items t, (SELECT @rownum := 0) r order by rank DESC) si GROUP
BY si.invoiceNo;
感谢任何帮助或建议。谢谢你:)
答案 0 :(得分:0)
你走了。
Select * From (SELECT t.*, @rownum := @rownum + 1 AS rank FROM
selected_items t, (SELECT @rownum := 0) r order by rank DESC) si
WHERE bill_type LIKE <Bill_type_value>
GROUP BY si.invoiceNo;
相应地替换<Bill_type_value>