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
怎么把这两条语句变为一条语句。
怎么把这两条语句变为一条语句。
select * from userlist where username = 'dan' and ppassword = 'dan' and usertype = 1 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 = 1
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 = 1
--------------------
因表结构不清楚,只能这样理解了~~