易截截图软件、单文件、免安装、纯绿色、仅160KB

sql2005 + VB6.0 在VB6.0中拼SQL 注意"()"

今天在调试的过程中发现 在vb中拼SQL的时候发现"()" 作用很大
eg: table: T_TEST col : T_KB int ,S_CD int ,Z_SU int
dim gcstrT_1 ,gcstrT_3  as integer
gcstrT_1  = 1
gcstrT_3  = 3
 strWhere = strWhere &  "……"
 strWhere = strWhere &  "AND ((T_KB = " & gcstrT_1 &; ") "   '注意点 AND 后面需要一个括号 "(" 
 strWhere = strWhere &  "OR "
 strWhere = strWhere &  " (T_KB = " &  gcstrT_3 &  " "
 strWhere = strWhere &  " AND S_CD IS NOT NULL "
 strWhere = strWhere &  " AND Z_SU > 0 )) "        '注意点 AND 后面需要一个括号 ")" 
 AND 后面的条件是一个整体,所以加"()"


相关文档:

VB.NET中操作xml文件(插入节点、修改、删除)

已知有一个XML文件(bookstore.xml)如下:
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
<price>5.95</price>
</book>
< ......

SQL Server2000 解析XML

DECLARE @HDOC INT --文档句柄
DECLARE @XMLSTRING VARCHAR(200) --XML字符串
SET @xmlString ='<?xml version="1.0"?>
<ROOT>
<USER ID="1" Name="SBQCEL"/>
<USER ID="2" Name="PEACELI"/>
<USER ID="3" Name="SHEEPCHANG"/>
</ROOT>'
--使用系统存储 ......

自定义多参数Sql聚合函数

Creating a CLR user define aggregate (part 2). Use multiple columns in the aggregation function
In part 1 we created a nice user defined aggregate. Now we are going to make it more sophisticated and let its value depend on two parameters ShipCountry and ShipShipCity. You might try having two parame ......

SQL查询重复记录

SQL查询重复记录
http://m.cnblogs.com/15628/1534873.html
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
[图片]select * from people
[图片]where peopleId in (select   peopleId  from   people  group  by   peopleId  ......

SQL用select语句查询重复记录

SQL用select语句查询重复记录
http://hi.baidu.com/bilbit/blog/item/5ed5de16a6f6b412962b43eb.html
用select语句,查询重复记录
假设,表名为 T1 子段为 A,B,C
select count(*) ,A,B,C from T1
   group by A,B,C having count(*) > 1
测试数据:
    A100    &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号