110,534
社区成员
发帖
与我相关
我的任务
分享
using System.Text;
string sql;
StringBuilder sb = new StringBuilder();
sb.Append("select * from corp where 1=1 ");
string key;
if(key!="")
{
sb.Append(" and corp_name='"+key+"' ");
}
sql=sb.ToString();
string sql;
string sql2="where 1=1";
string key;
if(key!="")
{
sql2=sql2 +"and a.corp_name='"+key+"'";
}
sql="select a.* from corp a "+sql2;
string sql;
string sql2="where 1=1";
string key;
if(key!="")
{
sql2=sql2 +"and a.corp_name='"+key+"'";
}
sql="select a.* from corp "+sql2;