- 浏览: 4507 次
- 性别:
- 来自: 上海
最新评论
文章列表
在网上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/ ...
mysql: 找最大值
- 博客分类:
- 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 exi ...
select *,count(distinct userName) from t_doctor group by userName;
这段可以用来去重复,很奇怪,先记下来。然后再自己研究下
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 g ...
将sublime添加到右键打开目录
- 博客分类:
- 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方式 ...
今天遇到一个奇怪的问题
使用 D('Custoemr')->find(1)语句没有sql执行,非常奇怪。
而用其他表的model的find方法却正常。再结合D('Custoemr')->add()方法不返回主键。
觉得问题应该出在主键上,于是再仔细检查customer表发现果不其然有两个主键。 其中一个是手误点上去的。
所以这里再次总结下,如果有表有多个主键,那么find和create方法都不会正常执行