Mysql limit用法
1.SELECT
*
from
table
LIMIT
1
,
20
;
//
检索记录行
2-21
第一个参数:查询起始行(从0开始)
第二个参数:查询几条记录
2.
SELECT
*
from
table
LIMIT
5
,
-
1
;
//
检索记录行
6
-
last.
3.
SELECT
*
from
table
LIMIT
5
;
//
检索前
5
个记录行
相关文档:
1、php与mysql建立连接
php.ini 加载mysql组件
extension=php_mysql.dll前的;去掉
exetension_dir=""路径是否正确
Php连接mysql函数
mysql_connect:开启MYSQL连接
mysql_select_dir:打开一个数据库
@和or die 隐藏错误和条件显示
mysql_connect("主机","用户名","密码");
mysql_sele ......
一直习惯使用小写的SQL保留字,没想到今天居然遇到了麻烦哈!!和谐一下MYSQL啦!
环境:Server version: 5.1.37-1ubuntu5 (Ubuntu)
alter table child_table_name
add constraint constraint_name
foreign key (column_1)
references reference_table_name(reference_column_1);
和
ALTER TABLE child_t ......
使用mysql时,通常表中会有一个自增的id字段,但当我们想将表中的数据清空重新添加数据时,希望id重新从1开始计数,用以下两种方法均可:
方法一:
alter table tablename drop column id;
alter table tablename add id mediumint(8) not null primary key auto_increment first;
方法二:
alter table tab ......
1.SET GLOBAL event_scheduler = ON;
2.show processlist;
3.创建一个表 test 主要字段 no,name,sex,age
4.对该表插如几条数据
5.创建存储过程add_age
drop procedure if exists add_age;
delimiter|
create procedure add_age()
begin
start transaction;
update eventtest set age = age +1;
&n ......
地址: http://imysql.cn/taxonomy/term/1?page=1
[InnoDB系列] -- innodb表如何更快得到count(*)结果:http://imysql.cn/2008_06_24_speedup_innodb_count
[InnoDB系列系列] -- 大数据量的导出导入方法比较:
http://imysql.cn/2007_10_15_large_innodb_table_export_import
[MySQL优化案例]系列 -- DISABLE/ENABLE K ......