摘要:
在SQL中,查询存在一个表而不在另一个表中的数据记录的方法有很多,介绍其中4种: 1、方法一(仅适用单个字段):使用 not in ,比较容易理解,缺点是效率低 如:select A.ID from A where A.ID not in (select ID from B); 2、方法二(适用多个 阅读全文
摘要:
一:筛选批注 1、 2、插入一个模块 3、写一个取出批注的函数: Function GetCom(x As Range) If x.Comment Is Nothing Then a = "" Else a = x.Comment.Text End IfGetCom = aEnd Function 阅读全文
摘要:
一般模糊查询语句如下: SELECT 字段 FROM 表 WHERE 某字段 Like 条件 其中关于条件,SQL提供了四种匹配模式: 1,% :表示任意0个或多个字符。可匹配任意类型和长度的字符,有些情况下若是中文,请使用两个百分号(%%)表示。 比如 SELECT * FROM [user] W 阅读全文
摘要:
所有表:select * from sysobjects where xtype='U' 或 select * from sys.tables 所有存储过程:select * from sysobjects where xtype='P' 或 select * from sys.procedures 阅读全文