按指定的时间间隔查找数据

本文关键字:查找 数据 时间 | 更新日期: 2024-07-27 12:17:59

类似这样的数据库记录:

===============================
Table
-------------------------------
ID,OtherID, MinNumber,MaxNumber
-------------------------------
1  A       10        100
2  A       101       500
3  A       501       800
-------------------------------
4  B       10        200
5  B       201       550
more ....
-------------------------------

滤波器(OtherID=ANumber=45

如何确定记录(筛选器)是否已存在于表中。

示例

SQL:

SELECT * FROM Table WHERE OtherID='A' AND  // code here

---或---

C#数据表:

DataTable dt= new DataTable(); (dt's structer and records like Table);
// code here 

谢谢!

按指定的时间间隔查找数据

我想你想要这个

Declare @int INT
Set @int = 45
SELECT * FROM Table WHERE OtherID='A' AND (@int Between MinNumber And MaxNumber)