TMP_HELLO中有实时CRM数据,希望通过seq获取最新产品
CREATE VIEW dbcrm.V_HELLO AS
CREATE TEMPORARY TABLE temp_table (count int);
insert into temp_table select max(seq) from dbcrm.TMP_HELLO group by ProductID;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT minute(aa.UpdateOn) - minute(aa.TickTime), aa.*
FROM dbcrm.TMP_HELLO aa
where aa.seq in (select count from temp_table) limit 10000;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
此视图供 MS SQL Server 的链接服务器读取