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
个记录行
相关文档:
show variables like 'character%';查看字符编码
--更改字符集
SET character_set_client = utf-8 ;
SET character_set_connection = utf-8 ;
SET character_set_database = utf-8 ;
SET character_set_results = utf-8 ;
SET character_set_server = utf-8 ;
SET collation_connection = utf8 ;
SET colla ......
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using MySql ......
一直习惯使用小写的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 ......
截取province字符串中第一个<br>前的字符串~!
update lcjd
set `province` = substring_index( `province` , '<br>', '1' );
在需要添加‘0’的位置添加一个‘0’
update lcjd
set lc_name2 = concat('0', lc_name2)
WHERE length(lc_name2) = 3
http://www.sqlstudy.com/s ......
//主键
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//增加一个新列
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default '0';
//删除列
alter table t2 drop column c;
//重命名列
......