数据库记录像这样:
===============================
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=A
,Number=45
)
如何确定表中是否已存在记录(过滤器)。
示例
SQL:
SELECT * FROM Table WHERE OtherID='A' AND // code here
---或---
C#DataTable:
DataTable dt= new DataTable(); (dt's structer and records like Table);
// code here
谢谢!
答案 0 :(得分:0)
我想你想要这个
Declare @int INT
Set @int = 45
SELECT * FROM Table WHERE OtherID='A' AND (@int Between MinNumber And MaxNumber)