有两个个表,数据量很大(百万级别)都只有一列,A表数据比B多
要求: 因为在View中,要求一个语句实现。
直接得到A表中去掉B表相同数据的最后值,谢谢!
------解决思路----------------------
你试下,哪个快点
SELECT [字段] FROM A EXCEPT SELECT [字段] FROM B
--
SELECT A.[字段] FROM A LEFT JOIN B ON A.[字段]=B.[字段] WHERE B.[字段] IS NULL
SELECT [字段] FROM A EXCEPT SELECT [字段] FROM B
--
SELECT A.[字段] FROM A LEFT JOIN B ON A.[字段]=B.[字段] WHERE B.[字段] IS NULL