摘要: 1、主要思想:根据已有数据,规则性的造数据select * FROM(select lId,strName,lId as lParentId,-1 as orderIdx from tbClassify WHERE lParentId = 0 UNION ALL(select t1.* from tbClassify t1 join(select lId from tbClassify where lParentId=0 order by orderIdx) t2 ont1.lParentId = t2.lId where 1=1 order by t1.lParentId,t1.orderI 阅读全文
posted @ 2013-10-11 16:53 风中鸣,雨中行 阅读(1188) 评论(0) 推荐(0) 编辑
摘要: 前几天,在技术交流会上,八期师哥提到了存储过程和触发器的区别和联系,原来我只知道,触发器时存储过程的一种,在机房收费系统个人版中也用到了存储过程和触发器,自己却没有深究,只道是自己会用就好,却没有将这两个拿出来好好的比较,好好的学习,心里着实惭愧。 无论是存储过程还是触发器,在数据库中的作用都是很大的,存储过程和触发器都是SQL语句和流程控制语句的集合,就本质而言,触发器其实也是一种特殊的存储过程,那为什么要这样说呢? 我个人认为,这是因为触发器和存储过程都是经过编译过的一组SQL语句,只不过说存储过程是要通过语句来调用才能实现,而触发器是通过某一个动作执行时或执行后自动调用,注意... 阅读全文
posted @ 2013-10-10 10:52 风中鸣,雨中行 阅读(407) 评论(0) 推荐(0) 编辑
摘要: SUBSTRING_INDEX(str,delim,count)Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (count 阅读全文
posted @ 2013-10-10 09:58 风中鸣,雨中行 阅读(281) 评论(0) 推荐(0) 编辑
摘要: #set($nPageIndex=$request.getParameter("nIndex"))#set($Integer = 0 )#set($FrontPageSize=$Integer.parseInt($nPageIndex) * $nPageSize) 阅读全文
posted @ 2013-09-25 16:27 风中鸣,雨中行 阅读(1219) 评论(1) 推荐(0) 编辑
摘要: 1、SELECT * from tbLabelResRelation WHERE lId in(32,18,27,19) order by FIND_IN_SET(lId ,'32,18,27,19');2、SELECT * from tbLabelResRelation WHERE lId in(32,18,27,19) order by substring_index('32,18,27,19',lId,1);3、SELECT lCourseId FROM tbNewSchoolCourse35 WHERE lCourseId IN ('2' 阅读全文
posted @ 2013-09-12 09:34 风中鸣,雨中行 阅读(451) 评论(0) 推荐(0) 编辑