交集和差集 MySQL中没有这两个运算,但是有并集运算,所以可以利用这个来间接实现. 差集: SELECT ID FROM ( SELECT DISTINCT A.AID AS ID FROM TABLE_A A UNION ALL SELECT DISTINCT B.BID AS ID FROM TABLE_B B ) as TEMP GROUP BY ID HAVING COUNT(ID) = 1; 并集: SELECT ID FROM ( SELECT DISTINCT A.AID AS…
浅拷贝: function extendCopy(p) { var c = {}; for (var i in p) { c[i] = p[i]; } return c; } 深拷贝: function deepCopy(p, c) { var c = c || {}; for (var i in p) { if (typeof p[i] === 'object') { c[i] = (p[i].constructor === Array) ? [] : {}; deepCopy(p[i], c…