国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
sql常用命令
sql常用命令
(1) 數(shù)據(jù)記錄篩選: 

sql="select * from 數(shù)據(jù)表 where 字段名=字段值 order by 字段名 [desc]" 

sql="select * from 數(shù)據(jù)表 where 字段名 like ‘‘%字段值%‘‘ order by 字段名 [desc]" 

sql="select top 10 * from 數(shù)據(jù)表 where 字段名 order by 字段名 [desc]" 

sql="select * from 數(shù)據(jù)表 where 字段名 in (‘‘值1‘‘,‘‘值2‘‘,‘‘值3‘‘)" 

sql="select * from 數(shù)據(jù)表 where 字段名 between 值1 and 值2" 

(2) 更新數(shù)據(jù)記錄: 

sql="update 數(shù)據(jù)表 set 字段名=字段值 where 條件表達(dá)式" 

sql="update 數(shù)據(jù)表 set 字段1=值1,字段2=值2 …… 字段n=值n where 條件表達(dá)式" 

(3) 刪除數(shù)據(jù)記錄: 

sql="delete from 數(shù)據(jù)表 where 條件表達(dá)式" 

sql="delete from 數(shù)據(jù)表" (將數(shù)據(jù)表所有記錄刪除) 

(4) 添加數(shù)據(jù)記錄: 

sql="insert into 數(shù)據(jù)表 (字段1,字段2,字段3 …) valuess (值1,值2,值3 …)" 

sql="insert into 目標(biāo)數(shù)據(jù)表 select * from 源數(shù)據(jù)表" (把源數(shù)據(jù)表的記錄添加到目標(biāo)數(shù)據(jù)表) 

(5) 數(shù)據(jù)記錄統(tǒng)計(jì)函數(shù): 

AVG(字段名) 得出一個(gè)表格欄平均值 
COUNT(*|字段名) 對(duì)數(shù)據(jù)行數(shù)的統(tǒng)計(jì)或?qū)δ骋粰谟兄档臄?shù)據(jù)行數(shù)統(tǒng)計(jì) 
MAX(字段名) 取得一個(gè)表格欄最大的值 
MIN(字段名) 取得一個(gè)表格欄最小的值 
SUM(字段名) 把數(shù)據(jù)欄的值相加 

引用以上函數(shù)的方法: 

sql="select sum(字段名) as 別名 from 數(shù)據(jù)表 where 條件表達(dá)式" 
set rs=conn.excute(sql) 

用 rs("別名") 獲取統(tǒng)的計(jì)值,其它函數(shù)運(yùn)用同上。 

(5) 數(shù)據(jù)表的建立和刪除: 

CREATE TABLE 數(shù)據(jù)表名稱(字段1 類型1(長(zhǎng)度),字段2 類型2(長(zhǎng)度) …… ) 

例:CREATE TABLE tab01(name varchar(50),datetime default now()) 

DROP TABLE 數(shù)據(jù)表名稱 (永久性刪除一個(gè)數(shù)據(jù)表)

select distinct * into yjkc2 from yjkc
drop table yjkc
select * into yjkc from yjkc2
drop table yjkc2


SQL連接方式==================================================

dim conn 
set conn=server.createobject("ADODB.connection") 
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=服務(wù)器;UID=用戶名;PWD=密碼;DATABASE=表名;"

access連接方式=================================================

dim conn 
dim connstr
on error resume next
connstr="DBQ="+server.mappath("數(shù)據(jù)庫(kù)路徑")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr 

包含頁(yè)========================================================
<!--#include file=文件名 -->


調(diào)用表=======================================================
set rs=server.createobject("adodb.recordset")
sql="select * from 表名 where 字段=變量 order by 字段 desc"
rs.open sql,conn,1,1

打開(kāi)數(shù)據(jù)庫(kù)之后固定修改某個(gè)字段
conn.execute("Update 表名 Set 字段=字段+1 Where 字段=變量"


刪除內(nèi)容======================================================
set rs=server.createobject("adodb.recordset")
sql="select * from 表名 where 字段=變量"
rs.open sql,conn,1,3
有圖片就刪除圖片
Picture=rs("newspic") 
set fs=server.CreateObject("scripting.filesystemobject") 
Picture=server.MapPath(Picture) 
if fs.FileExists(Picture) then 
fs.DeleteFile Picture,true 
end if 
rs.delete
rs.update
response.redirect request.servervariables("http_referer")
end if

分頁(yè)=====================================================

<table width="98%" border="0" cellspacing="1" cellpadding="3" bgcolor="cccccc">
<tr bgcolor="f5f5f5">
<td width=10% align=center>
<font color="">id 
</td>
<td width=40% align=center>關(guān) 鍵 詞;</td>
<td width=10% align=center>價(jià)   格</td>
<td width=20% align=center>修   改</td>
<td width=20% align=center>刪   除</td>
</tr>
<%
If Request.QueryString("page") = "" or Request.QueryString("page") = 0 then
page = 1
Else
page = CINT(Request.QueryString("page"))
End If
if request("pm")="" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from p_words order by id desc"
rs.open sql,conn,1,1
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from p_words where pm_name like ‘%"&request("pm")&"%‘"
rs.open sql,conn,1,1
end if
if rs.eof and rs.bof then%>
<tr >
<td width=10% align=center colspan="6" >
暫時(shí)沒(méi)有記錄?。?br>
</td>
</tr>
<%
else
%>
<%
RS.PageSize=10‘設(shè)置每頁(yè)記錄數(shù)          
Dim TotalPages             
TotalPages = RS.PageCount             
            
If page>RS.Pagecount Then             
page=RS.Pagecount             
end if             
            
RS.AbsolutePage=page
rs.CacheSize = RS.PageSize‘設(shè)置最大記錄數(shù)  
Dim Totalcount             
Totalcount =INT(RS.recordcount)             
            
StartPageNum=1             
do while StartPageNum+10<=page             
StartPageNum=StartPageNum+10             
Loop             
               
EndPageNum=StartPageNum+9             
            
If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount %>
<%I=0
p=RS.PageSize*(page-1)             
do while (Not RS.Eof) and (I<RS.PageSize)             
p=p+1%>

<form action="?act=move&id=<%=rs("id")%>" method=post name=form1>
<tr bgcolor="#FFFFFF">
<td align=center><%=rs("id")%></td>
<td><input type=text name="pm_name" size=12 value="<%=rs("pm_name")%>"></td>
<td align=center><input type=text name="pm_p" size=8 value="<%=rs("pm_p")%>"></td>
<td align=center><input type=‘submit‘ class=‘button‘ value=‘修改‘></td>
<td align=center><input type="button" name="Submit" value="刪除" class="button" onclick="location=‘biglist.asp?act=del&id=<%=rs("id")%>‘"></td>
</tr>
</form>

<%I=I+1             
RS.MoveNext             
Loop%> 
            
  
<tr> <td colspan="6" align=right height=30>
   共有<font color=red><%=rs.recordcount%></font>個(gè)關(guān)鍵詞,<font color=red><%=page%></font>/<%=TotalPages%>頁(yè)
【<a href="<%=request.ServerVariables("URL")%>?page=1">首頁(yè)</a>】 
<% if page>1 then %>
【<a href="<%=request.ServerVariables("URL")%>?page=<%=StartPageNum-1%>">上一頁(yè)</a>】
<%else%>
<%end if%>
<% For I=StartPageNum to EndPageNum                         
   if I<>page then %><A href="?page=<%=I%>"><u><%=I%></u> </A><% else %><font color=red><%=I%></font> <% end if %><% Next %><% if EndPageNum<RS.Pagecount then %>
【<a href="<%=request.ServerVariables("URL")%>?page=<%=EndcPageNum+i%>">下一頁(yè)</a>】
<%end if%>
【<a href="<%=request.ServerVariables("URL")%>?page=<%=TotalPages%>">尾頁(yè)</a>】

</td></tr>


<%
end if
rs.close
%>  

</table>


常用JAVA===========================================================
response.write"<SCRIPT language=JavaScript>alert(‘該關(guān)鍵詞已經(jīng)存在。‘);"
response.write"javascript:history.go(-1)</SCRIPT>"
‘response.redirect "biglist.asp"
‘response.write"this.location.href=‘index.asp‘;</SCRIPT>" 
‘response.redirect request.servervariables("http_referer")
response.end



常用命令=============================================================

兩個(gè)表循環(huán)
<%
dim crs1
dim csql1
Set crs1= Server.CreateObject("ADODB.Recordset") 
csql1="select * from commercetype" 
crs1.open csql1,conn,1,1
%>
<%do while not crs1.eof%>
<%
Set all= Server.CreateObject("ADODB.Recordset")
csql1="select * from Commerce where Typeid="&crs1("Typeid")
all.open csql1,conn,1,1

%>
<td width="20%" height=17 bgcolor="#E4F4FC" valign=middle>
<font color=red>
<%if not all.eof then%>
<%=all.recordcount%>
<%else%>
0
<%end if%>
</font>
</td>
<%
crs1.movenext
loop
%>

去掉太長(zhǎng)的錄入文字:
<td style="word-wrap:break-word;word-break:break-all;">

<%=ltrim(arr(j))%>
去掉左空格
instr(request.form("t"),",")>0
查驗(yàn)是否有,號(hào)
arr=split(request.form("t"),",") 
去掉,并付值給arr
ubound(arr) 
個(gè)數(shù)

ASP函數(shù)介紹

1. 函數(shù)array() 功能:創(chuàng)建一個(gè)數(shù)組變量 格式:array(list) 參數(shù):list 為數(shù)組變量中的每個(gè)數(shù)值列,中間用逗號(hào)間隔 例子: 結(jié)果: i 被賦予為數(shù)組

2. 函數(shù)Cint() 功能:將一表達(dá)式/其它類型的變量轉(zhuǎn)換成整數(shù)類型(int) 格式:Cint(expression) 參數(shù):expression 是任何有效的表達(dá)式/其它類型的變量 例子: 結(jié)果: 236 函數(shù)Cint()將字符"234"轉(zhuǎn)換 成整數(shù)234.如果表達(dá)式為空, 或者無(wú)效時(shí),返回值為0; 

3. 函數(shù):Creatobject() 功能:創(chuàng)建及返回一個(gè)ActiveX對(duì)象. 格式:Creatobject(obname) 參數(shù):obname 是對(duì)象的名稱 例子: 結(jié)果: 

4. 函數(shù)Cstr() 功能:將一表達(dá)式/其它類型的變量轉(zhuǎn)換成字符類型(string) 格式:Cstr(expression) 參數(shù):expression是任何有效的表達(dá)式/其它類型的變量 例子: 結(jié)果:函數(shù)Cstr()將整數(shù) 5 轉(zhuǎn)換 成字符"5". 

5. 函數(shù)Date() 功能:返回當(dāng)前系統(tǒng)(server端)的日期 格式:Date() 參數(shù):無(wú) 例子<% date () %> 結(jié)果:05/10/00 

6. #.函數(shù)Dateadd() 功能:計(jì)算某個(gè)指定的時(shí)間和 格式:dateadd(timeinterval,number,date) 參數(shù):timeinterval是時(shí)間單位(月,日..); number是時(shí)間間隔值,date是時(shí)間始點(diǎn). 例子: 結(jié)果: 11/4/99 3:34:45 PM 其中 "m" = "month"; "d" = "day"; 如果是currentDate 格式,則, "h" = "hour"; "s" = "second"; 

7. #.函數(shù)Datediff() 功能:計(jì)算某量個(gè)指定的時(shí)間差 格式:datediff(timeinterval,date1,date2[,firstdayofweek[,firstdayofyear>) 參數(shù):timeinterval 是時(shí)間單位; date1,date2是有效的日期表達(dá)式,firstdayofweek,firstdayofyear 是任意選項(xiàng). 例子: 結(jié)果:There are 150 days to millenium from 8/4/99. 

8. #.函數(shù)day() 功能:返回一個(gè)整數(shù)值,對(duì)應(yīng)于某月的某日 格式:day(date) 參數(shù):date是一個(gè)有效的日期表達(dá)式; 例子lt;% =date(#8/4/99#) %> 結(jié)果:4 

9. #.函數(shù)formatcurrency() 功能:轉(zhuǎn)換成貨幣格式 格式:formatcurrency(expression [,digit[,leadingdigit[,paren[,groupdigit>>) 參數(shù):expression 是有效的數(shù)字表達(dá)式;digit表示小數(shù)點(diǎn)后的位數(shù);leadingdigit,paren,groupdigit是任意選項(xiàng). 例子lt;%=FormatCurrency(34.3456)%> 結(jié)果34.35 
10. #.函數(shù)Formatdatetime() 功能:格式化日期表達(dá)式/變量 格式:formatdatetime(date[,nameformat]) 參數(shù):date為有效的日期表達(dá)式/變量;nameformat是指定的日期格式常量名稱. 例子lt;% =formatdatetime("08/04/99",vblongdate) %> 結(jié)果:Wednesday,August 04,1999 

11. #.函數(shù)Isnumeric() 功能:返回一個(gè)布爾值,判斷變量是否為數(shù)字變量,或者是可以轉(zhuǎn)換成數(shù)字的其它變量. 格式:isnumeric(expression) 參數(shù):expression 是任意的變量. 例子: 結(jié)果: true. 

12. #.函數(shù)Isobject() 功能:返回一個(gè)布爾值,判斷變量是否為對(duì)象的變量, 格式:isobject(expression) 參數(shù):expression 是任意的變量. 例子: 結(jié)果: true 


13. #.函數(shù):Lbound() 功能:返回一個(gè)數(shù)組的下界. 格式:Lbound(arrayname[,dimension]) 參數(shù):arrayname 是數(shù)組變量,dimension 是任意項(xiàng) 例子: 結(jié)果:0 

14. #.函數(shù)Lcase() 功能:將一字符類型變量的字符全部變換小寫(xiě)字符. 格式:Lcase(string) 參數(shù):string是字符串變量 例子: 結(jié)果:this is lcase! 

15. #.函數(shù)left() 功能:截取一個(gè)字符串的前部分; 格式:left(string,length) 參數(shù):string字符串,length截取的長(zhǎng)度. 例子: 結(jié)果:this i 

16. #.函數(shù)len() 功能:返回字符串長(zhǎng)度或者變量的字節(jié)長(zhǎng)度 格式:len(string |varname) 參數(shù):string字符串;varname任意的變量名稱 例子: 結(jié)果:15 

17. #.函數(shù)ltrim() 功能:去掉字符串前的空格. 格式:ltrim(string) 參數(shù):string 字符串. 例子: 結(jié)果:Today 

19. #.函數(shù)minute() 功能:返回一數(shù)值, 表示分鐘 格式:minute(time) 參數(shù): time是時(shí)間變量 例子lt;% =minute(#12:23:34#) %> 結(jié)果:23 

20. #.函數(shù)month() 功能:返回一數(shù)值, 表示月份 格式:month(time) 參數(shù):time是日期變量 例子lt;% =month(#08/09/99) %> 結(jié)果:9 

21. #.函數(shù)monthname() 功能:返回月份的字符串(名稱). 格式:Monthname(date [,abb]) 參數(shù):date是日期變量,abb=true時(shí) 則月份的縮寫(xiě), 例子: 結(jié)果:April 

22. #.函數(shù)Now() 功能:返回系統(tǒng)的當(dāng)前時(shí)間和日期. 格式:now() 參數(shù):無(wú) 例子: 結(jié)果: 05/10/00 8:45:32 pm 

23. #.函數(shù):replace() 功能:在字符串中查找,替代指定的字符串. 格式:replace(strtobesearched,strsearchfor,strreplacewith [,start[,count[,compare>]) 參數(shù):strtobesearched是字符串; strsearchfor是被查找的子字符串;strreplacewith 是用來(lái)替代的子字符串.start,count,compare 是任意選項(xiàng). 例子: 結(jié)果:this is an orange. 

24. #.函數(shù)right() 功能:截取一個(gè)字符串的后部分 格式:right(string,length) 參數(shù):string字符串,length截取的長(zhǎng)度. 例子: 結(jié)果:st! 

25. #.函數(shù)rnd() 功能:返回一個(gè)隨機(jī)數(shù)值 格式:rnd[(number)] 參數(shù):number是任意數(shù)值. 例子: 結(jié)果:0/1數(shù)值之一,無(wú)randomize(), 則不能產(chǎn)生隨機(jī)數(shù). 

26. #.函數(shù)round() 功能:完整數(shù)值 格式:round(expression[,numright]) 參數(shù):expression數(shù)字表達(dá)式;numright任意選項(xiàng). 例子: 結(jié)果: 12 

27. #.函數(shù)rtrim() 功能:去掉字符串后的空格. 格式:rtrim(string) 參數(shù):string 是字符串 例子: 結(jié)果:this is a test! 

28. #.函數(shù)second() 功能:返回一個(gè)整數(shù)值. 格式:second(time) 參數(shù):time是一個(gè)有效的時(shí)間表達(dá)式; 例子lt;% =second(# 12:28:30#) %> 結(jié)果:30 

29. #.函數(shù)strReverse() 功能:返回與原字符串排列逆向的字符串. 格式:strreverse(string) 參數(shù):string是字符串 例子lt;% =strreverse("this is a test!") 結(jié)果:!tset a si siht 

30. #.函數(shù)time() 功能:返回當(dāng)前系統(tǒng)的時(shí)間值. 格式:time() 參數(shù):無(wú) 結(jié)果:9:58:28 Am 關(guān)鍵詞:ASP 

31. #.函數(shù)trim() 功能:刪去字符串前,后的空格. 格式:trim(string) 參數(shù):string 字符串. 例子: 結(jié)果:this is a test! 

32. #.函數(shù)UBound() 功能:返回一個(gè)數(shù)組的上界. 格式:Ubound(expression [,dimension]) 參數(shù):expression 是數(shù)組表達(dá)式/數(shù)組變量,dimension 是任意項(xiàng) 例子: 結(jié)果: 2 

33. #.函數(shù):UCase() 功能:將一字符類型變量的字符全部變換成大寫(xiě)字符. 格式:Ucase(string) 參數(shù):string是字符串變量 例子: 結(jié)果:THIS IS LCASE! 

34. #.函數(shù)Vartype() 功能:返回變量的常量代碼(整數(shù)) 格式:Vartype(varname) 參數(shù):varname是任何類型的變量名稱. 例子: 結(jié)果:2 (2表示整數(shù),須要參考ASP常量代碼.) 

35. #.函數(shù)Weekday() 功能:返回一個(gè)整數(shù),對(duì)應(yīng)一周中的第幾天. 格式:Weekday(date [,firstofweek]) 參數(shù):date為日期變量,firstofweek為任選項(xiàng). 例子: 結(jié)果:3(3 表示是星期二) 

36. #.函數(shù)weekdayname() 功能:返回字符串,對(duì)應(yīng)星期幾. 格式:weekdayname(weekday[,abb[,firstdayofweek>) 參數(shù):weekday為日期變量,abb,firstdayofweek為任選項(xiàng). 例子: 結(jié)果: Wednesday 

37. #.函數(shù)year() 功能:返回日期表達(dá)式所在的年份. 格式:year(date) 參數(shù):date是有效的日期表達(dá)式 例子: 結(jié)果:1999
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
VBA連接數(shù)據(jù)庫(kù)
自定義查詢 | Sensors Analytics 使用手冊(cè)
[原創(chuàng)] Xcode中使用sqlite3訪問(wèn)數(shù)據(jù)庫(kù)
VFP常用命令及用法、實(shí)例
Visual C++ ADO數(shù)據(jù)庫(kù)編程入門
SQL存儲(chǔ)過(guò)程入門級(jí)教程4
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服