TinyInt ---- 1ByteSmallInt -- 2BytesInt ---------- 4BytesBigInt ----- 8Bytes
假設我們要搜尋Start與End時間點內所有的區間(3,4,5,6)用法如下:
string expression = string.Format("(Start_DateTime<='{0}' AND End_DateTime>='{0}') OR (Start_DateTime<='{1}' AND End_DateTime>='{1}') OR (Start_DateTime>='{0}' AND End_DateTime<='{1}') OR (Start_DateTime<='{0}' AND End_DateTime>='{1}')", startTime, endTime);DataRow[ ] rows = table.Select(expression);
//此時找到的會是 3,4,5,6 這四個區間