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

Sql½¨¿â½¨±í

1.½¨¿â
declare @dbName varchar(20),@dataName varchar(2000),@dataPath varchar(2000),@logName varchar(2000),@logPath varchar(2000)
set @dbName='DB_Exam_OnLine_YHK'
set @dataName='DB_Exam_OnLIne_YHK_DB'
set @dataPath='D:\gaoFang\Exam\App_Data\DB_Exam_OnLIne_YHK_DB.mdf'
set @logName='DB_Exam_OnLIne_YHK_LG'
set @logPath='D:\gaoFang\Exam\App_Data\DB_Exam_OnLIne_YHK_LG.ldf'
exec('CREATE DATABASE '+@dbName+' on (name='+@dataName+', FILENAME='''+@dataPath+''') LOG ON (name='+@logName+', FILENAME='''+@logPath+''')')

2.ÅÅÐòʱҪעÒ⣺Èç1£¬11£¬9
µ±Îª×Ö·ûÐÍvarcharÅÅÐòʱΪ£º1£¬11£¬9
µ±ÎªÊýÖµÐÍint,decimal,floatµÈʱÅÅÐòΪ£º1£¬9£¬11
ËùÒÔ×Ö·ûÐ͵ÄÅÅÐò¿ÉÒÔÕâÑùдorder by Convert(decimal,×Ö·ûÐÍÊý¾Ý×Ö¶Î) »òÕßorder by Covert(Interge,×Ö·ûÐÍÊý¾Ý×Ö¶Î)


Ïà¹ØÎĵµ£º

Asp.netÓëSQLÒ»Æð´ò°ü²¿Êð°²×°


Õû¸öSQLºÍAsp.net(vb.net)Ò»Æð´ò°üµÄÈ«¹ý³ÌдһÏ¡£
Ò».×¼±¸±ØÒªµÄÎļþ
1. SQL½Å±¾Îļþ£¬Éú³ÉÒÔºó°²×°¹ý³ÌÖÐÐèÒªµÄ±íºÍ´æ´¢¹ý³ÌµÈµÈ£»
Éú³ÉÖ®ºó£¬¾ÍÔÝʱ°ÑËüÃüÃûΪdb.sql(×¢Òâ´óСд)
2.LisenceFile.rtfµÄ°²×°Îļþ£¬ÒòΪÎÒµÄϵͳÊǸöÈ˵ģ¬¶øÇÒfreeµÄ£¬ËùÒÔ¾ÍûÓÐ×ö¡£Õâ¸öÒÔºóÒ²ÊÇÒªÓõ½µÄ¡£
¶þ.ÔÚ×Ô¼ºÏÖÓеÄÏîÄ¿Àïà ......

OracleÖÐSQL PLUSµÄ³£ÓÃÖ¸Áî

½øÈësql*plusÐèÒªÊäÈëÓû§Ãû¡¢¿ÚÁîºÍÖ÷»ú±êÖ¾·û
system/manager
sys/change_on_intall
scott/tiger
internal/oracle
ÒÔÉÏΪ³õʼÃÜÂë
Ö÷»ú×Ö·û´®¿Õ»òÕßÊÇ@+ÄãµÄ·þÎñÃû,ÔÚ±¾µØµÇ½²»ÐèÒª±¾µØ·þÎñÃû¡£
ÏÂÃæ¾Í½éÉÜÒ»ÏÂһЩ³£ÓõÄsql*plusÃüÁ
Ê×ÏȲ鿴µ±Ç°Ê¹ÓõÄÊý¾Ý¿âʵÀý:
select name from V$database;
Çл»Á½¸ö ......

SQL²åÈëÀýÌâ

--´´½¨±íTongXunLu
CREATE TABLE TongXunLu
 (
 [tName] nvarchar(30),
 [tAddress] nvarchar(50),
 [tEmail] varchar(50)
 )
--´´½¨±í students
CREATE TABLE students
 (
 [sId] int IDENTITY (1, 1) primary key NOT NULL ,
 [sName] varchar (50)   NOT ......

SQLÓï¾ä£ºGroup By Óï¾äС½á

1. Group By Óï¾ä¼ò½é£º
Group ByÓï¾ä´ÓÓ¢ÎĵÄ×ÖÃæÒâÒåÉÏÀí½â¾ÍÊÇ“¸ù¾Ý(by)Ò»¶¨µÄ¹æÔò½øÐзÖ×é(Group)”¡£ËüµÄ×÷ÓÃÊÇͨ¹ýÒ»¶¨µÄ¹æÔò½«Ò»¸öÊý¾Ý¼¯»®·Ö³ÉÈô¸É¸öСµÄÇøÓò£¬È»ºóÕë¶ÔÈô¸É¸öСÇøÓò½øÐÐÊý¾Ý´¦Àí¡£
P.S. ÕâÀïÕæÊÇÌå»áµ½ÁËÒ»¸öºÃµÄÃüÃûµÄÁ¦Á¿£¬Group By´Ó×ÖÃæÊÇÖ±½ÓÈ¥Àí½âÊǷdz£ºÃÀí½âµÄ¡£¶÷£¬ÒÔºóÔÚÃü ......

SQLÁÙʱ±í

ÁÙʱ±í¾ÍÊÇÄÇЩÃû³ÆÒÔ¾®ºÅ (#) ¿ªÍ·µÄ±í¡£Èç¹ûµ±Óû§¶Ï¿ªÁ¬½ÓʱûÓгýÈ¥ÁÙʱ±í£¬SQL Server ½«×Ô¶¯³ýÈ¥ÁÙʱ±í¡£ÁÙʱ±í²»´æ´¢ÔÚµ±Ç°Êý¾Ý¿âÄÚ£¬¶øÊÇ´æ´¢ÔÚϵͳÊý¾Ý¿â tempdb ÄÚ¡£
ÁÙʱ±íÓÐÁ½ÖÖÀàÐÍ£º
±¾µØÁÙʱ±í
ÒÔÒ»¸ö¾®ºÅ (#) ¿ªÍ·µÄÄÇЩ±íÃû¡£Ö»ÓÐÔÚ´´½¨±¾µØÁÙʱ±íµÄÁ¬½ÓÉϲÅÄÜ¿´µ½ÕâЩ±í£¬Á´½Ó¶Ï¿ªÊ±ÁÙʱ±í¼´±»É¾³ý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ