linq to sqlÉú³Énot inÓï¾äµÄС¼¼ÇÉ
ÒÔÇ°Ò»Ö±¾õµÃlinq to sqlÉú³ÉÀàËÆwhere id not in (1,3,5)»òwhere id not in (select id from ...)ÕâÑùµÄÌõ¼þ²»ÊǺܷ½±ã£¬Ã¿´ÎÎÒ¶¼ÊÇ°ÑÌõ¼þIDÊÂÏÈÈ¡µ½Ò»¸öÊý×éÀȻºóÓà !Arr.Contains(c.Id)ÕâÑù´¦Àí£¬½ñÌìͻȻ·¢ÏÖÕâÑùºÃɵ£¬Æäʵ¿ÉÒÔÍêÈ«Ö±½ÓÓÃlinqд³ÉÒ»¾ä£¬Ìù¸öʾÀýÔÚÕâÀÒԺ󱸲é
from a in TableA where !(from b in TableB Where ... select b.Id).Contains(a.Id)
×îÖÕ·Òë³öÀ´µÄÓï¾ä²¢·Ç¸únot in ÍêÈ«Ò»ÑùµÄ£¬¶øÊÇÓÃnot exists(...)£¬²»¹ýЧ¹ûÍêÈ«Ïàͬ£¬ÄÜ´ïµ½ÒªÇó¾ÍÐÐÁË£¡
Ïà¹ØÎĵµ£º
7¡¢¶ÔÏóÀàÐͼ̳Ð
¶ÔÏóÀàÐÍʵÏÖÔÊÐíÎÒÃÇ´´½¨Ò»¸ö»ùÀàÐÍ£¬»ò½Ð¸¸ÀàÐÍ£¬ÕâÖÖÀàÐ͵ÄÊôÐÔ»ò·½·¨¿ÉÒÔ±»ÁíÒ»¸ö¶ÔÏóÀàÐͼ̳С£È»ºó¿ÉÒÔ´´½¨Ò»¸ö×ÓÀàÐÍ£¬»ò½Ðº¢×ÓÀàÐÍ£¬Ö±½ÓʹÓü̳йýÀ´µÄÊôÐÔ»ò·½·¨£¬»òÕßÓÃ×Ô¼ºµÄÊôÐԺͷ½·¨ÖØд¸¸ÀàÐ͵ÄÊôÐÔ»ò·½·¨¡£
INSTANTIABLE¹Ø¼ü×Ö±íʾÎÒÃÇ¿ÉÒÔ´Ó¸ÃÀàÐÍÖÐʵÀý»¯»òÕß´´½¨¶ÔÏ ......
Merge statement
function benefits: 1) provides the ability to conditionally update, insert or delete data into a database table. 2) performs an update if the row exists, and an insert if it is a new row. --> 1) avoids seperate updates, 2) increase performance and ease of use. 3) is useful in dat ......
CREATE VIEW MYVIEW
AS
SELECT * from bjxxdiweb_database2007.dbo.bm_tongji
UNION ALL
SELECT * from aa.DBO.chen
select * into aa..chen from bjxxdiweb_database2007.dbo.bm_tongji where 1=2
˵Ã÷£ºÊý¾Ý¿âAµÄ±íµÄ×Ö¶ÎÃû±ØÐëºÍÊý¾Ý¿âBµÄ±íµÄ×Ö¶ÎÃûÏàͬ£¬°üÀ¨Êý¾ÝÀàÐ͵ȡ£ ......
--> Title : SQL ServerϵͳÊÓͼ
--> Author : wufeng4552
--> Date : 2009-10-28
Ŀ¼ÊÓͼ
Ŀ¼ÊÓͼ·µ»Ø SQL Server Êý¾Ý¿âÒýÇæʹÓõÄÐÅÏ¢¡£½¨ÒéÄúʹÓÃĿ¼ÊÓͼÕâÒ»×î³£ÓõÄĿ¼ԪÊý¾Ý½çÃ棬Ëü¿ÉΪÄúÌṩ×îÓÐЧµÄ·½·¨À´»ñÈ¡¡¢×ª»»²¢ÏÔʾ´ËÐÅÏ¢µÄ×Ô¶¨ÒåÐÎʽ¡£ËùÓÐÓû§¿ÉÓÃĿ¼Ԫ ......
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace DAL
{
......