在一张access表中嵌套查询
strSQLCmd.Format(_T("select * from (select * from talk_info where %s ='%s') where %s ='%s'"),
strVar,strValue,strVar2,strValue2);
请问这语句有问题吗
没有问题。
建议你通过调试把这个 ("select * from (select * from talk_info where %s ='%s') where %s ='%s'"),strVar,strValue,strVar2,strValue2)
输出看一下结果是什么? 估计你的变量有问题。
strSQLCmd内容是什么
CString strSQLCmd;
是不是变量的值代进去是这中形式啊:strSQLCmd.Format(_T("select * from (select * from talk_info where strVar ='strValue') where strVar2 ='strValue2'");
相关问答:
数据库表名为:table1
其中一个字段名为:name1
name1 中内容可能是:你 好
注:“你好”这两个字中间的空格不能确定多少个
请问怎么才能当输入“你好”这两个字的时候,可以查询出含有“你&nbs ......
IsSqlDataBase = 0 '主数据库类型(1=SQL,0=AC)
'===========================================================================
SqlDatabaseName = "ads365" '主数据库名
S ......
HTML code:
<HTML>
<HEAD>
<TITLE>Information Display</TITLE>
</HEAD>
<BODY>
<%
Dim conn
set conn=server.createobject ("adodb.connection")
conn ......
select top 20 * from tb
where 字段名 not in
(select top 10 字段名 from tb)
我知道用这种方法可以得到10-20的数据
但是如果数据很多
比如select top 100020 * from tb
where 字段名 not ......