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

aspÍøÒ³Àï,sql³£ÓòÙ×÷Óï¾ä!

Ìí¼Ó¡¢É¾³ý¡¢ÐÞ¸ÄʹÓÃ
db.Execute(Sql)ÃüÁîÖ´ÐвÙ×÷
╔----------------╗
¡î Êý¾Ý¼Ç¼ɸѡ ¡î
╚----------------╝
×¢Ò⣺µ¥Ë«ÒýºÅµÄÓ÷¨¿ÉÄÜÓÐÎó(ûÓвâʽ)
 
Sql = "Select
Distinct
×Ö¶ÎÃû from Êý¾Ý±í"
Distinctº¯Êý£¬²éѯÊý¾Ý¿â´æ±íÄÚ²»Öظ´µÄ¼Ç¼
 
Sql = "Select Count(*) from Êý¾Ý±í where
×Ö¶ÎÃû1>#18:0:0# and ×Ö¶ÎÃû1< #19:00# "
countº¯Êý,²éѯÊý¿â±íÄÚÓжàÉÙÌõ¼Ç¼£¬“×Ö¶ÎÃû1”ÊÇָͬһ×Ö¶Î
Àý£º
set rs=conn.execute("select count(id) as idnum from news")
response.write rs("idnum")
 
sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû between Öµ1 and
Öµ2"
Sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû between
#2003-8-10# and #2003-8-12#"
ÔÚÈÕÆÚÀàÊýֵΪ2003-8-10 19:55:08
µÄ×Ö¶ÎÀï²éÕÒ2003-8-10ÖÁ2003-8-12µÄËùÓмǼ£¬¶ø²»¹ÜÊǼ¸µã¼¸·Ö¡£
 
select * from tb_name   where datetime between #2003-8-10# and
#2003-8-12#
×Ö¶ÎÀïÃæµÄÊý¾Ý¸ñʽΪ£º2003-8-10
19:55:08£¬Í¨¹ýsql²é³ö2003-8-10ÖÁ2003-8-12µÄËùÓмͼ£¬¶ø²»¹ÜÊǼ¸µã¼¸·Ö¡£
 
 
Sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû=×Ö¶ÎÖµ order by
×Ö¶ÎÃû [desc]"
 
Sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû like ’’%×Ö¶ÎÖµ%’’
order by ×Ö¶ÎÃû [desc]"
Ä£ºý²éѯ
 
×¢Ò⣺mysqlÓëORACLEÊý¾Ý¿â´æÔÚ²»Í¬
Sql="select
top 10
*
from Êý¾Ý±í where ×Ö¶ÎÃû order by ×Ö¶ÎÃû [desc]"
Sql="select *fromÊý¾Ý±íwhere×Ö¶ÎÃûorder   by×Ö¶ÎÃû[desc]

limit
10
"
 
²éÕÒÊý¾Ý¿âÖÐÇ°10¼Ç¼
 
Sql="select top n * form Êý¾Ý±í order by newid()"
Ëæ»úÈ¡³öÊý¾Ý¿âÖеÄÈô¸ÉÌõ¼Ç¼µÄ·½·¨
top n£¬n¾ÍÊÇҪȡ³öµÄ¼Ç¼Êý
 
Sql="select * from Êý¾Ý±í where ×Ö¶ÎÃû in
(’’Öµ1’’,’’Öµ2’’,’’Öµ3’’)"
 
╔----------------╗
¡î Ìí¼ÓÊý¾Ý¼Ç¼ ¡î
╚----------------╝
sql="insert into Êý¾Ý±í (×Ö¶Î1,×Ö¶Î2,


Ïà¹ØÎĵµ£º

SQL Server µÄÄ£Äâ

SQL Server µÄÄ£Äâ
רÀ¸×÷¼Ò£ºDeanna Dicken 2010Äê2ÔÂ12ÈÕ
·­Ò룺    UltraDBA      2010Äê5ÔÂ25ÈÕ
Ô­ÌûµØÖ·£ºhttp://www.databasejournal.com/features/mssql/article.php/3863516/SQL-Server-Impersonation.htm
½éÉÜ
SQL Server µÄÄ£Ä⣬»òÉÏÏÂÎÄÇл»£¬ÊÇÒ»ÖÖ·½Ê½£¬ÔÊÐíµ± ......

ÔõÑù½«excelÖеÄÊý¾Ýͨ¹ýPL/SQLµ¼ÈëORACLEÊý¾Ý¿âÖÐ

ÏêϸµØ²½Öè:


1¡¢´ò¿ªMicroSoft   Excel   2000  


2¡¢Îļþ(F)→н¨(N)→¹¤×÷²¾→  


3¡¢ÊäÈëÊý¾Ýºó£¬´æÅÌΪtest.xls£¬  


4¡¢Îļþ(F)→Áí´æΪ(A)→  


±£´æÀàÐÍΪ£ºÖƱí·û·Ö¸ô£¬ÆðÃûΪtext.txt£¬±£´æµ½C:\ &nb ......

SQL Default Ô¼Êø£¡

´´½¨Ò»ÕÅ±í£¬Ö±½ÓÔÚ±íÁÐÉÏ°ó¶¨Ä¬ÈÏÖµ
CREATE TABLE hello
(
Id_P int PRIMARY KEY,
Firstname varchar(50) DEFAULT 'Bush',
Lastname varchar(50) DEFAULT 'Green',
Address varchar(50) DEFAULT 'China',
City varchar(50) DEFAULT 'beijing'
)
²åÈëÒ»ÌõÐÅÏ¢
INSERT INTO hello(Id_P) values(01)
½á¹ûÊÇ
×ܽ ......

asp´ÓÊý¾Ý¿âÖÐÊä³öµÄ¶«Î÷»»ÐÐ

 <%  
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from 0791idc_News where BigClassName='¼Ò×°¿ÎÌÃ' order by ID desc"
rs.Open sql,Conn,1,1
if rs.eof and rs.bof then
  response.Write("ÔÝʱûÓмǼ")
else
%>
         ......

ASPÑ­»·Êä³ö±í¸ñÐÐtrµÄ·½·¨

  <%
for i=1 to rs.recordCount '±äÁ¿i´Ó1Ñ­»·µ½Êý¾Ý¿âÖеÄÈ«²¿¼Ç¼Êý
if (i mod 1 =1) then 'ÿ¸ötr¼´Ã¿ÐÐÏÔʾ1¸ö¼Ç¼,¿É¸ù¾ÝÐèÒª×ÔÐÐÐÞ¸Ä, ½«×ó±ßµÄ1ÐÞ¸ÄΪ2¼´ÏÔʾÁ½ÐС£
response.write "<tr align='center'>"
end if
%>
´Ë´¦ÎªÒªÑ­»·µÄÄÚÈÝ
  <%if (i mod 1 = 0) then ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ