Dynamic SQL
Date: 07/26/06
(Code WTF) Keywords: no keywords
if (RoleId > 0) { RoleJoin = ""; } else { RoleJoin = "--"; }
query = "select * from blablabla " + RoleJoin + "INNER JOIN sometable ON (someJoinCondition AND RoleId in (" + RoleId + "))";
ps украдено тут
Source: http://community.livejournal.com/code_wtf/45008.html
|