Select count(a) AS A,count(b) AS B,count(c) AS C,count(d) AS D From AAA
这个怎么判断是否有数据?比如数字 select count(*) from AAA where a <> 0
文本 select count(*) from AAA where b <>''
select count(*) from AAA where c is not null
首先谢谢两位,我想: 在查询分析器中 Select count(a) AS A,count(b) AS B,count(c) AS C,count(d) AS D From AAA没问题 用VB,如何一次性获取每列的行数?不想分开一个一个获取。
用个记录集反应这个SQL语句的结果就行了 for i=0 to rs.fields.count debug.print rs.fields(i).value next
这个问题sql版讨论过,结果忘了。
informix里通过,你要知到systable一样的。 Select (select count(*) from AAA where a is not null), (select count(*) from AAA where b is not null), (select count(*) from AAA where c is not null), (select count(*) from AAA where d is not null) from systables where tabid = 1
select count(*) from AAA where a <> 0
select count(*) from AAA where b <>''
在查询分析器中
Select count(a) AS A,count(b) AS B,count(c) AS C,count(d) AS D From AAA没问题
用VB,如何一次性获取每列的行数?不想分开一个一个获取。
for i=0 to rs.fields.count
debug.print rs.fields(i).value
next
Select
(select count(*) from AAA where a is not null),
(select count(*) from AAA where b is not null),
(select count(*) from AAA where c is not null),
(select count(*) from AAA where d is not null)
from
systables
where
tabid = 1