Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ms sql Ò»´Î²åÈë¶àÌõ¼Ç¼µÄÓï¾ä

ÓеÄʱºòÎÒÃÇÐèÒªÒ»´ÎÏñÊý¾Ý¿âÖÐÌí¼Ó¶àÌõ¼Ç¼£¬ÎÒÃÇ¿ÉÒÔʹÓÃÏÂÃæµÄÓï¾äÀ´ÊµÏÖ£º
--Ìí¼ÓÒ»Ìõ¼Ç¼
INSERT INTO tableName(col1,col2,col3) VALUES (1,2,3)
--Ìí¼Ó¶àÌõ¼Ç¼
INSERT INTO tableName(col1,col2,col3)
SELECT 3,4,5
UNION ALL
SELECT 6,7,8
--´ÓÁíÍâµÄÒ»ÕűíÖжÁÈ¡¶àÌõÊý¾ÝÌí¼Óµ½Ð±íÖÐ
INSERT INTO tableName(col1,col2,col3)
SELECT a,b,c from tableA
--´ÓÆäËûµÄ¶àÕűíÖжÁÈ¡Êý¾ÝÌí¼Óµ½Ð±íÖÐ
INSERT INTO tableName(col1,col2,col3)
SELECT a,b,c from tableA WHERE a=1
UNION ALL
SELECT a,b,c from tableB WHERE a=2
ÔÚmysql¿ÉÒÔÕâÑù
insert
 
into
 tablefortest(a,b)
values
(
1
,
2
) ,(
3
,
4
) ,(
5
,
6
)


Ïà¹ØÎĵµ£º

ÓÃASP.NET»¹Ô­Óë»Ö¸´Sql server

ÉÏ´Î×öÁ˸öÏîÄ¿£¬Éæ¼°µ½Êý¾Ý¿âµÄ»¹Ô­ºÍ»Ö¸´£¬µ½ÍøÉÏÕÒÁËһϣ¬ÊÇÀûÓÃSQLDMOʵÏֵģ¬Ö»ÒªÌí¼ÓSQLDMOÒýÓþͺÃÁË£¬È»ºóÀûÓÃϱߵÄÀàµÄ·½·¨¾Í¿ÉÒÔʵÏÖÁË¡£
¡¡¡¡ÎÒ°ÑÔ­×÷ÕßµÄÀàÀ©³äÁËһϣ¬¿ÉÒÔ×Ô¶¯Ê¶±ðweb.configÀï µÄÊý¾Ý¿âÁ¬½Ó×Ö·û´®£¬¿ÉÒÔͨ¹ý±äÁ¿ÉèÖû¹Ô­»Ö¸´µÄÐÅÏ¢¡£
¡¡¡¡ÐèҪעÒâµÄʱ»¹Ô­£¬»¹Ô­µÄʱºòÎÊÌâ×î´óÁË£¬Óбð ......

²âÊÔMSSQLÖÐSQLÓï¾äÖ´Ðл¨·ÑµÄʱ¼ä

selectÓï¾äǰ¼Ó£º
declare @d datetime
set @d=getdate()
²¢ÔÚselectÓï¾äºó¼Ó£º
select [Óï¾äÖ´Ðл¨·Ñʱ¼ä(ºÁÃë)]=datediff(ms,@d,getdate())
ת×Ô£º¶¯Ì¬ÍøÖÆ×÷Ö¸ÄÏ www.knowsky.com
ÕâÊǼòÒ׵IJ鿴ִÐÐʱ¼äµÄ·½·¨¡£
===========================================£¨Ò»ÏÂÄÚÈÝת×Ô£º£Ã£Ó£Ä£Î£©
MSSQL ServerÖÐͨ¹ý²é ......

C#ÓëSQL Server 2000ʵÏÖÎÞÏÞ¼¶²Ëµ¥


//tree.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Syst ......

SQL ¼Ü¹¹

¼Ü¹¹£¨Schema£©¡£Î¢ÈíµÄ¹Ù·½ËµÃ÷£¨MSDN£©£º
"Êý¾Ý¿â¼Ü¹¹ÊÇÒ»¸ö¶ÀÁ¢ÓÚÊý¾Ý¿âÓû§µÄ·ÇÖØ¸´ÃüÃû¿Õ¼ä£¬Äú¿ÉÒÔ½«¼Ü¹¹ÊÓΪ¶ÔÏóµÄÈÝÆ÷"£¬Ïêϸ²Î¿¼
http://technet.microsoft.com/zh-cn/library/ms190387.aspx.ÎÒÃÇÖªµÀ£¬ÔÚJAVAÖУ¬ÃüÃû¿Õ
¼äÃûÆäʵ¾ÍÊÇÎļþ¼ÐÃû¡£Òò´ËÎÒÃǷdz£Ã÷È·Ò»µã£ºÒ»¸ö¶ÔÏóÖ»ÄÜÊôÓÚÒ»¸ö¼Ü¹¹£¬¾ÍÏ ......

SQL Pivot & UnPivot

create table students (
  name varchar(25),
  class varchar(25),
  grade int
)
insert into students values ('ÕÅÈý','ÓïÎÄ',20)
insert into students values ('ÕÅÈý','Êýѧ',90)
insert into students values ('ÕÅÈý','Ó¢Óï',50)
insert into students values ('ÀîËÄ','ÓïÎÄ',81)
insert in ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ