查询数据表... [英] Querying a data table...

查看:78
本文介绍了查询数据表...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个数据表,其中包含一个描述和三个表示选择区域的复选框..

数据表绑定到一个网格,该网格..
然后,用户可以在说明所适合的三个区域之一的框中打勾.

用户完成检查后,我需要将其包含在SQL标准中以根据其选择描述的结果选择记录..

例如...
说明需求(复选框1)维护(复选框2)保修(复选框3)


红色是(复选框1)
蓝色是(复选框1)
绿色是(复选框2)
黄色是(复选框3)


现在我想从另一个文件中选择记录,该文件的描述位于复选框的其中一个

其他文件

说明日期值
红色01/01/2010 $ 30
蓝色02/02/2010 $ 45
红色2010年3月1日$ 10
绿色2010年2月2日$ 20
黄色2010年5月2日$ 15
绿色2010年6月1日$ 22


需求输出(复选框1)
红色01/01/2010 $ 30
蓝色02/02/2010 $ 45
红色2010年3月1日$ 10

维护输出
绿色2010年2月2日$ 20
绿色2010年6月1日$ 22

保修输出
黄色2010年5月2日$ 15

我需要一个或多个SQL语句,这些语句将允许我创建SQL语句的"in"子句或"Exists"语句.

谢谢

Scott

I have created a data table with a description and three checkboxes which represent selection areas..

The datatable is bound to a grid which..
the user can then place a check in the box of one of the three areas that the description fits in..

Once the user has completed the checking, I need to include that into a SQL criteria to select records based on the outcome of their selections of description..

Eg...
Description Demand(Checkbox1) Maintenance(CheckBox2) Warranty(Checkbox3)


Red yes(Checkbox1)
Blue yes(Checkbox1)
Green yes(Checkbox2)
Yellow yes(Checkbox3)


now I want to select records from another file where the description is in one of the checkbox selections

other file

Description Date Value
Red 01/01/2010 $30
Blue 02/02/2010 $45
Red 03/01/2010 $10
Green 04/02/2010 $20
Yellow 05/02/2010 $15
Green 06/01/2010 $22


Output for Demand(Checkbox1)
Red 01/01/2010 $30
Blue 02/02/2010 $45
Red 03/01/2010 $10

Output for Maintenance
Green 04/02/2010 $20
Green 06/01/2010 $22

Output for Warranty
Yellow 05/02/2010 $15

I need the SQL Statement or Statements that will allow me to create the "in" clause or the "Exists" statments..of an SQL Statment..


Thanks

Scott

推荐答案

30
蓝色02/02/2010
30
Blue 02/02/2010


45
红色2010年3月1日
45
Red 03/01/2010


10
绿色2010年2月2日
10
Green 04/02/2010


这篇关于查询数据表...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆