[原创]在access里可用的查询语句,嵌到c#里就提示"from 子句错误",
在access里可用的查询语句,嵌到c#里就提示"from 子句错误",如下:access 查询:
SELECT BID
FROM Book
WHERE BID in (select BID
from Book
where CID = @CID
AND BID not in
(select BID
from Lease ))
or BID in (select BID
from Lease where BID IN
(select BID
from Book where CID = @CID)
AND BackDate is NOT NULL);
查询字符串:
string selectBIDSql = "select BID from Book"
+ "where BID in (select BID from Book"
+ "where CID = @CID AND BID not in"
+"(select BID from Lease ))"
+ "or BID in "
+ "(select BID from Lease where BID IN"
+ "(select BID from Book where CID = @CID) "
+ "AND BackDate is NOT NULL)";//查询BID语句
迫其希望得到您的指点。