摘要:
无效的方法:select * from table1 where name like '%#name#%'两种有效的方法: 1) 使用$代替#。此种方法就是去掉了类型检查,使用字符串连接,不过可能会有sql注入风险。select * from table1 where name like '... 阅读全文
摘要:
SQL Server 中 with tmp 临时表的用法----------with临时表用法,有时候采用临时表比采用in的效率更高,避免了全表扫描。实例中实现了查询普通题、大题、子题目的sql-----------(对于大题套小题,采用先查小题信息再反查大题相关信息的方式)一、简答1. 会计师的定... 阅读全文
摘要:
Sqlserver 存储过程中结合事务的代码--方式一if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[USP_ProcedureWithTransaction_Demo]') and OBJECTPROPER... 阅读全文
摘要:
产生一个int数组,长度为100,并向其中随机插入1-100,并且不能重复用一个ArrayList存储1到100然后随机产生0到arraylist.size()之间的数字作为下标然后从arraylist中remove掉刚产生的那个下标的数存到数组中,直到arraylist中的size为0即可,这样就不用去判断浪费大量时间,用set的话虽然表面上没做判断,实际上也是判断过的public class Rand { public static void main(String[] args) { int[] fill = new int[100]; List list = new Array... 阅读全文