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" ......
µ¼³öÕû¸öÊý¾Ý¿â£ºmysqldump -uÓû§Ãû -pÃÜÂë ÐèÒªµ¼³öµÄÊý¾Ý¿âÃû > µ¼³öÎļþÃû.sql
ÆäËû²ÎÊý£º
-d ²»°üº¬Êý¾Ý£¬Ö»ÓÐÊý¾Ý¿â±í½á¹¹
--add-drop-table ÔÚÿ¸öcreateÓï¾ä֮ǰÔö¼ÓÒ»¸ödrop
--skip-opt ÿÌõ¼Ç¼ֻ¶ÔÓ¦Ò»¸öinsertÓï¾ä ......
To support MySQL Cluster, you will need to update
my.cnf
as shown in the following example.
You may also specify these parameters on the command line when
invoking the executables.
Note
The options shown here should not be confused with thos ......
1.mysqlµ¼³öÊý¾Ý¿âÃüÁî
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû (±íÃû) > c:\\ÎļþÃû.sql
2.mysqlµ¼ÈëÊý¾Ý¿âÃüÁî
£¨1£©½â¾öÖÐÎÄÂÒÂëÎÊÌ⣺ִÐÐÈçÏÂÃüÁîÔÙµ¼È룺set names utf8
£¨2£©µÇ¼mysql£¬Ö´ÐÐÈçÏÂÃüÁ
mysql> source c:\\ÎļþÃû.sql;
3½â¾öÖÐÎÄÂÒÂëÎÊÌ⣺ִР......
//µÃ·Ö¼ÆËãËÄÉáÎåÈë
SELECT ROUND((SUM(getfeng)/SUM(totalfeng))*100) as feng from answerdata WHERE uid='151' AND targetid IS NOT NULL
1.ceil £¨£© /ceiling£¨£© ÏòÉÏÈ¡Õû
Àý£º ceil£¨1.2£© = 2
2.floor £¨£© ÏòÏÂÈ¡Õû
Àý£º floor£¨1.2£© = 1
3.round£¨£© ËÄÉáÎåÈë
&n ......