mysqlÖвåÈëÒ»Ìõ¼Ç¼·µ»Ø¸Ã¼Ç¼id
1.select max(id) from user;
2.select last_insert_id() as id from user limit 1;
(Õâ¸ö²âÊԵķµ»ØidÒ»Ö±ÊÇ0£¬ÓеãÎÊÌâ)
3.´¢´æ¹ý³Ì
1£©
oracelÖÐ
create sequence seqID
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
nocache
order;
create or replace procedure sp_insert(aName int,rst out int) is
begin
insert into tablename(id,name) values(seqID.nextval,aName);
rst:=seqID.currval;
end;
2£©mysqlÖÐʵÏÖ
DELIMITER $$
DROP PROCEDURE IF EXISTS `test` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `test`(in name varchar(100),out oid int)
BEGIN
insert into user(loginname) values(name);
select max(id) from user into oid;
select oid;
END $$
DELIMITER ;
È»ºóÖ´ÐÐ
call test('gg',@id);
¾Í·µ»Øid
Ïà¹ØÎĵµ£º
aspxÒ³Ãæ
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="customin.aspx.cs" Inherits="kf_customin" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ......
http://dev.mysql.com/doc/refman/5.1/zh/index.html
(MySql 5.1 ÖÐÎIJο¼ÊÖ²á)
*------------------------------------------------------------------------------------------
show databases; ÏÔʾÊý¾Ý¿â
drop database Êý¾Ý¿âÃû;ɾ³ýÊý¾Ý¿â
set names 'utf8';ÉèÖÃÊý¾Ý¿â±àÂëΪutf-8
source x:\Êý¾Ý¿âÃû.sql;µ¼È ......
MySQL ClusterÅäÖÃstep by step
À´Ô´£ºhttp://space.itpub.net/15415488/viewspace-620903
¹«Ë¾ÓиöÏîÄ¿ÊDzâÊÔdistributed DB£¬ÆäÖÐÒ»ÏîÊÇÕë¶ÔMySQL ClusterµÄ²âÊÔ¡£
ÓÚÊÇ»¨ÁËÁ½Ììʱ¼ä×°»úÆ÷ºÍÅäÖÃMySQL Cluster¡£Õû¸ö¹ý³Ì»¹ÊDZȽÏ˳ÀûµÄ£¬µ±È»Èç¹û¶ÔMySQL³£ÓÃÃüÁî±È½ÏÊìϤµÄ»°»á¸ü˳Àû¡£
ÁôÏÂstep by stepÅä ......
create database sample;
create table 't_user' (
'id' int(11) not null auto_increment,
'name' varchar(100) not null default '',
primary key ('id')
) type=myisam;
Ñ¡ÏîÖ»ÔÚMySQL 3.23ºÍÒÔºó°æ±¾Öб»ÊµÏÖ¡£
²»Í¬µÄ±íÀàÐÍÊÇ£º
ISAM ÔÀ´µÄ±í´¦ÀíÆ ......
°²×°µÄOSΪSolaris10,mysql °æ±¾ÊÇ5.1.38
Ò»¡¢Ê¹ÓÃRPM°ü½øÐа²×°
Ê×ÏÈ¿ÉÒÔ´Ó°²×°¹âÅÌÖлòÕßµ½mysqlµÄÍøÕ¾ÉÏÏÂÔØ¶ÔÓ¦°æ±¾µÄrpm°üÈçÏ£º
MySQL-server-community-5.1.38-0.rhel5.i386.rpm
MySQL-client-community-5.1.38-0.rhel5.i386.rpm
½Ó×ÅÎÒÃÇ¿ÉÒÔʹÓÃrpmÃü ......