当前位置:编程学习 > VB >>

SQL查询并返回


查询数据库中列字段(x1,y1)第一行中x2,y2值相同的行,并且返回enthandle值 --------------------编程问答-------------------- 查询数据库中列字段x1=第一行中x2的值  和 列字段y1=第一行中y2的值 的行,并且返回enthandle值 --------------------编程问答-------------------- select * from vanshubiao where x1 = x2 and y1 = y2 --------------------编程问答-------------------- Select 编号 From cansubiao Where x1 In (Select x2 From cansubiao Where 编号 = 160) And y1 In (Select y2 From cansubiao Where 编号 = 160) And  编号 <> 160 --------------------编程问答--------------------
引用 3 楼 of123 的回复:
Select 编号 From cansubiao Where x1 In (Select x2 From cansubiao Where 编号 = 160) And y1 In (Select y2 From cansubiao Where 编号 = 160) And  编号 <> 160

若是我想提取此行的x2,y2并且把它们存到数组里,怎么办,还有select是不是只能返回一条记录,要是返回多条记录,是不是要用到记录集
补充:VB ,  数据库(包含打印,安装,报表)
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,