在某些条件下,我们要求网站的某页上显示指定的信息,
但是这种指定如果固定去用代码写死的话,对以后的改动将会是大麻烦;
这时候sql语句的优势就凸显出来,利用sql语句只需要改改数字,就能让显示的内容彻底替换;
代码如下:
[e:loop={'select * from phome_ecms_news where id in (2452,2697,2299,2267)',4,24,0...
分类:
数据库 时间:
2014-05-22 13:14:19
阅读次数:
425
测试结论
mysql版本 5.1
表类型: innodb, row_format=compact (这是默认的行格式)
插入超过10个blob, blob的数据量很小(
插入超过10个blob, blob的数据量很大(>768字节), 插入失败:报 Got error 139 from storage engine。
注意,如果mysql服...
分类:
数据库 时间:
2014-05-22 11:55:10
阅读次数:
347
Remove Nth Node From End of List删除链表倒数的第N个元素...
分类:
其他好文 时间:
2014-05-22 11:15:52
阅读次数:
170
1.在没有设置默认值的情况下:
SELECT userinfo.id, user_name, role, adm_regionid, region_name , create_time
FROM userinfo
LEFT JOIN region ON userinfo.adm_regionid = region.id
结果:
设置显示默认值:
SELECT userinfo.id, u...
分类:
数据库 时间:
2014-05-22 08:09:29
阅读次数:
418
文件配置如下:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:sch...
分类:
编程语言 时间:
2014-05-22 07:38:58
阅读次数:
388
1、 索引介绍
索引是用于加速数据存取的数据对象,是对数据表中一个或多个列进行排序的结构。合理的使用索引可以大大降低I/O次数,从而提高数据访问性能。
2、 问题:为什么需要索引?
Select * from scott.emp where empno=’8379’ --遍历emp表?
制约程序规模增大的两个瓶颈:网络和数据库,需要用更好的方式组织、管理数据。
3、 索引分类
? 按索引列个数...
分类:
数据库 时间:
2014-05-22 06:25:09
阅读次数:
346
#查看数据库版本
mysql> select @@version;
+------------+
| @@version |
+------------+
| 5.5.16-log |
+------------+
1 row in set (0.00 sec)
mysql> select * from information_schema.schemata; # 保存了系统...
分类:
数据库 时间:
2014-05-20 15:05:07
阅读次数:
456
表T_phone中字段:Id, Haoduan, Adress, Type,
Quhao1,ROW_NUMBER()是个开窗函数,它可以与聚合函数一起用,就算删除表中的列,排序也不会乱select *,ROW_NUMBER()
over(order by id) as 排序 from T_Phone...
分类:
其他好文 时间:
2014-05-20 13:16:26
阅读次数:
260
--SELECT TOP 3 Name,Age,Gender FROM View_Student
WHERE GROUP having ORDER BY id
DESC----在最终生成用户想要的数据之后,才进行排序,如果不得不排序,那么就尽可能吧消耗减到最小--ALTER VIEW View_St...
分类:
其他好文 时间:
2014-05-20 09:20:36
阅读次数:
360
戳我去解题Given a linked list, remove thenthnode from
the end of list and return its head.For example, Given linked list:
1->2->3->4->5, and n = 2. Aft...
分类:
其他好文 时间:
2014-05-20 08:04:28
阅读次数:
291