SQL问题 业务场景:如下截图 数据库语法是: select i.item_id, i.item_code as 物料编码, i.item_name as 物料名称, u.uom_name as 单位, v.vendor_id, v.vendor_code as 供应商编号, v.vendor_name as 供应商名称, p.price_tax as 含税价, p.price_notax as 不含税价, case when is_referenced = 2 then '暂估价' else '正式价' end price_type , p.start_date as 开始日期, p.end_date as 结束日期 from srm_purchase_price p, item i, vendor v, uom u where p.item_id = i.item_id and i.uom_id = u.uom_id and p.vendor_id = v.vendor_id and p.price_status = 2 and is_referenced <>'2' and i.item_code='710201120056' 但这个不是最终想要的数据,我想要710201120056这个物料最新的供应商单价,他们有2个供应商,我只需显示各个供应商的最近的单价就可以了,即显示第一行和最后一行,这个如何操作。 |