读书人

sql 语句有关问题感谢大家

发布时间: 2012-03-02 14:40:28 作者: rapoo

sql 语句问题,感谢大家
string sql = "select * from userlist where username = ' " + this.txtname.Text + " ' and ppassword = ' " + this.txtpwd.Text + " ' and usertype = ' "+this.ddlsubschoolname.Text+ " ' ";

string sss = " select sum(cast(c.ischeck as tinyint))as summ ,count (*) as countt from roleright a inner join RoleRight b ON A.Funname = '工作安排 ' AND b.FunListType = A.FunId inner join usertypefun c on c.funid = a.funid and c.usertype = ' " + Session[ "branch "].ToString()+ " ' ";

其中Session[ "branch "].ToString()是前一个查询语句中的usertype
怎么把这两条语句变为一条语句。




[解决办法]
string sss = " select sum(cast(c.ischeck as tinyint))as summ ,count (*) as countt from roleright a inner join RoleRight b ON A.Funname = '工作安排 ' AND b.FunListType = A.FunId inner join usertypefun c on c.funid = a.funid and c.usertype = ' "+this.ddlsubschoolname.Text+ " ' ";

读书人网 >asp.net

热点推荐