本文介绍了如何在C Sharp中编写SQL Querry代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

select distinct
        sec_mrf_details.fnid_int
from    sec_umrf_details
        left join sec_mrf_details on sec_umrf_details.mrfno_nu = sec_mrf_details.mrfno_nu
        left join sec_functions on  sec_functions.fnid_int = sec_mrf_details.fnid_int
        left join sec_roles on sec_roles.roleid_int = sec_mrf_details.roleid_int
        left join sec_modules on sec_modules.modid_int = sec_mrf_details.modid_int
        left join sec_users on  sec_users.userid_vc = sec_umrf_details.userid_vc
where   sec_umrf_details.deleted_int=0
        and sec_umrf_details.userid_vc='i-jadoon' and sec_mrf_details.modid_int = 11

推荐答案


StringBuilder SQL = new StringBuilder("");
SQL.Append("select distinct sec_mrf_details.fnid_int from    sec_umrf_details ");
SQL.Append(" left join sec_mrf_details on sec_umrf_details.mrfno_nu = sec_mrf_details.mrfno_nu ");
SQL.Append("  left join sec_functions on  sec_functions.fnid_int = sec_mrf_details.fnid_int ");
SQL.Append("left join sec_roles on sec_roles.roleid_int = sec_mrf_details.roleid_int
 ");
SQL.Append(" left join sec_modules on sec_modules.modid_int = sec_mrf_details.modid_int ");
SQL.Append("left join sec_users on  sec_users.userid_vc = sec_umrf_details.userid_vc ");
SQL.Append("where   sec_umrf_details.deleted_int=0
        and sec_umrf_details.userid_vc='i-jadoon' and sec_mrf_details.modid_int = 11
 ");
string Query = string.Format(SQL.ToString());



这篇关于如何在C Sharp中编写SQL Querry代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 13:24