ITeye博客

guoweisharp的博客

guoweisharp · 共 6 篇文章

spring boot 跑junit 报错

在网上copy一个spring boot junit的实例,想要测试一下Request请求 http://blog.csdn.net/catoop/article/details/50752964 将url替换成可用地址后, run as -> junit test 发现报错了,log如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/…

2017-08-03 10:16 · spring boot · 评论(0)

mysql: 找最大值

要求:获得 按table1_id分组,并且age最大的 记录信息,即2、3、5条 方法一: select * from (select * from table2 order by age desc) as a group by a.table1_id 方法二: select a.* from table2 as a where age = (select max(age) from table2 where a.table1_id=table1_id) 方法三: select a.* from table2 as a where not exists (select * from tabl…

2016-02-24 15:25 · mysql · 评论(0)

mysql 表按字段去重复

select *,count(distinct userName) from t_doctor group by userName; 这段可以用来去重复,很奇怪,先记下来。然后再自己研究下

2016-02-24 15:23 · mysql · 评论(0)

mysql:ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or RE

MySQL开启bin-log后,调用存储过程或者函数以及触发器时,会出现错误号为1418的错误: ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL,or READS SQL DATA in its declaration and binary logging is enabled(you *might* want to use the less safe log_bin_trust_function_creators variable) 在MySQL中创建函数时出现这种错误的解决方法: set global…

2015-07-09 15:24 · mysql · 评论(0)

将sublime添加到右键打开目录

1. 运行中输入 regedit 打开注册表 2. 在HKEY_CLASSES_ROOT/*/shell/ 下新建’项’ ,名称自己觉得.我用的是Sublime Text 3. 在 Sublime Text 下 新建’项’ 名字:command (这个貌似不可以修改) 4. 点击 command ,在右边的(默认),双击填入下面的值: D:\Program Files\Sublime Text 2\sublime_text.exe "%1" 前面是exe的绝对物理地址, %1 用tab方式打开不同的文档(必须)

2015-06-01 18:02 · sublime · 评论(0)

thinkphp mode的find方法失效

今天遇到一个奇怪的问题 使用 D('Custoemr')->find(1)语句没有sql执行,非常奇怪。 而用其他表的model的find方法却正常。再结合D('Custoemr')->add()方法不返回主键。 觉得问题应该出在主键上,于是再仔细检查customer表发现果不其然有两个主键。 其中一个是手误点上去的。 所以这里再次总结下,如果有表有多个主键,那么find和create方法都不会正常执行

2015-06-01 15:41 · thinkphp · 评论(0)