create or replace view imp_stockprice as
select c.code as pk_org,b.vcode,b.vname,d.code as customer,e.code as pk_material,f.code as pk_unit,g.code as pk_currtype,
a.nprice1 as gbj,a.nprice2 as zk,a.nprice3 as tzj,a.nprice4 as cjj,substr(a.ts,0,20) as ts,a.dr,e.enablestate
from prm_tariff a
left join prm_tariffdef b on b.pk_tariffdef=a.pk_tariffdef
left join org_orgs c on c.pk_org=a.pk_org
left join bd_customer d on d.pk_customer=a.pk_customer
left join bd_material e on e.pk_material=a.pk_material
left join bd_measdoc f on f.pk_measdoc=a.pk_unit
left join bd_currtype g on g.pk_currtype=a.pk_currtype
where e.setpartsflag='N'and b.dr=0 and d.enablestate=2 and d.dr=0 and c.enablestate=2;
我是一名新手菜鸟 在写一个SQL视图的时候 发现同一个数据被修改过 但是原来的数据还在 ,我想直接查所有数据的时候,通过取修改时间最大值来筛选数据 把那些以前的数据过滤掉
因为我在代码里是直接查询的这个视图 所以大佬们 有没有办法在这个视图里实现这个功能呢?