这条SQL语句如何写 我用ADO查询记录号为10--30或30--50的记录,语句如何写啊,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 cstring strsql="select * from table where (id between 10 and 30) or (id between 30 and 50)";Open((_variant_t)strsql...使用_RecordsetPtr的open方法就行了 也可以使用>、<号between 关键字是包含两头的数据的,比如:SELECT title_id, ytd_salesFROM titlesWHERE ytd_sales BETWEEN 4095 AND 12000GO下面是结果集:title_id ytd_sales -------- ----------- BU1032 4095 BU7832 4095 PC1035 8780 PC8888 4095 TC7777 4095 SELECT title_id, ytd_sales FROM titles WHERE ytd_sales > 4095 AND ytd_sales < 12000 GO下面是结果集:title_id ytd_sales -------- ----------- PC1035 8780 (1 row(s) affected) cstring strsql="select * from table where (id >=10 and id<=30) or (id >=30 and id<=50)"; cstring strsql;strsql.format("select *from table where (id<=10 and id<=30) or(id>30 and id<=50"); listctrl控件某列加入按钮 Xtreme Toolkit Pro 12.1.1安装后到底有多大? 谁搞过IPV6?没一点头绪,谁能给点资料? VC应用在哪些方面? 为什么打不开注册表? ★★★ 200分送:有关AC3的原理或者相关文档 (紧急!)★★★ 难题:关于OCX控件中非窗口对象的键盘响应问题?问题解决1000分相送。 全局变量的问题? 兔子党是什么样的组织,如何加入??? 如何做一个椭圆形的button,并且上面还有自己画的位图?急用!谢谢 关于opegl,auxSolidBox,内存泄漏以及实体交并差运算的问题 CSocket中的send(),receive()是不是阻塞的?
使用_RecordsetPtr的open方法就行了
between 关键字是包含两头的数据的,比如:
SELECT title_id, ytd_sales
FROM titles
WHERE ytd_sales BETWEEN 4095 AND 12000
GO下面是结果集:title_id ytd_sales
-------- -----------
BU1032 4095
BU7832 4095
PC1035 8780
PC8888 4095
TC7777 4095
SELECT title_id, ytd_sales
FROM titles
WHERE ytd_sales > 4095 AND ytd_sales < 12000
GO下面是结果集:title_id ytd_sales
-------- -----------
PC1035 8780 (1 row(s) affected)
strsql.format("select *from table where (id<=10 and id<=30) or(id>30 and id<=50");