1.判断列内是否有重复值: Dim arrT As Range Dim rng As Range Set arrT = Range("A:A")'判读A列单元格 For Each rng In arrT If rng = Empty Then'如果单元格为空就退出循环,否者循环65535次 Exit For End If k = Application.CountIf(arrT, rng)’用CountIf函数扫描出重复值,跟excel的CountIF函数一样 If k > 1
mysql text字段判断是否为空 mysql text字段为空select * from `tableName` where `textField` is null or `textField` = ''; mysql text字段不为空select * from `tableName` where `textField` is not null AND `textField` != '';
判断表是否存在: 语法: SELECT * FROM dbo.SysObjects where id = object_id(N'表名') 例子: SELECT * FROM dbo.SysObjects where id = object_id(N'ExchangeLog') if exists(SELECT * FROM dbo.SysObjects where id = object_id(N'ExchangeLog')) print '表存在' else print '表不存在' 判断列
mybatis判断集合为空或者元素个数为零: <if test="mlhs != null and mlhs.size() != 0"> and t.mlh_name not in <foreach collection="mlhs" item="item1" open="(" close=")" index="i" separator=",">
package com.lanxi.demo2; import java.util.HashSet; import java.util.Iterator; import java.util.Set; public class Test { public static void main(String[] args) { //引用一个Set集合实现类 Set set=new HashSet(); //添加单个元素 set.add("哈"); set.add("士");
1. 'API判断数组为空或没有初始化 Private Declare Function SafeArrayGetDim Lib "oleaut32.dll" (ByRef saArray() As Any) As Long Private Sub Command1_Click()Dim tmp() As StringIf SafeArrayGetDim(tmp) = 0 ThenMsgBox "数组为空或没有初始化"End IfEnd Sub 2. Private