日期:2014-05-18 浏览次数:20556 次
select * from feelist where feebuyerSp in("+feebuySp+") and feebuyerSp is not null
------解决方案--------------------
string sql = "";
if(feebuySp == "")
{
sql = select * from feelist }
else
{
sql = select * from feelist where feebuyerSp in("+feebuySp+")
}
------解决方案--------------------
select * from feelist where feebuyerSp is null or feebuyerSp ='' or feebuyerSp like '%'+feebuySp+'%')
------解决方案--------------------
if isnull(feebuySp,'')='' select * from feelist
------解决方案--------------------
select * from feelist where feebuyerSp in("+feebuySp+") or feebuyerSp !=""
------解决方案--------------------
string sql = "select * from feelist"; if(feebuyerbhFX.Text.Trim().Length) { string feebuySp="'"+feebuyerbhFX.Text.Replace(",","','")+"'"; sql += " where feebuyerSp in("+feebuySp+")"; }
------解决方案--------------------
如果feebuySp<>null then
select * from feelist where feebuyerSp in("+feebuySp+")
否则 select * from feelist
------解决方案--------------------
string feebuySp = "'" + feebuyerbhFX.Text.Replace(",", "','") + "'"; string sql = "select * from feelist where feebuyerSp in ('"+feebuySp+"')";
------解决方案--------------------
select * from feelist where feebuyerSp is null
------解决方案--------------------
在程序中加个判断,分别用不同的SQL
if(feebuySp==null)
{
select * from feelist
}
else
{
select * from feelist where feebuyerSp in("+feebuySp+")
}
------解决方案--------------------