易截截图软件、单文件、免安装、纯绿色、仅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 后面的条件是一个整体,所以加"()"


相关文档:

sql 查询重复记录2

sql 查询重复记录2
http://blog.csdn.net/tobeistdo/archive/2009/11/11/4797545.aspx
========第一篇=========
在一张表中某个字段下面有重复记录,有很多方法,但是有一个方法,是比较高效的,如下语句:
select data_guid from adam_entity_datas a where a.rowid > (select min(b.rowid) from adam_entity_datas ......

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 ......

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号