1. 在sql語句中什麼時候加逗號 什麼時候不加
查詢、修改多個欄位時需要添加,其他的不用添加,使用空格即可。
2. 如何使用sql語句查詢文字中的逗號
sql=update table set 欄位名=replace(欄位名,',',',') WHERE 欄位名
REGEXP ","
/*replace=>sql更改某個字元串某部分字元,中間為原始字元,後為理想字元
REGEXP為sql正則匹配模式。通配所有該欄位含英文半形的*/
3. SQL中用逗號來分隔數據
用,分隔數據的讀取:
<%
a="a,b,c,d,e,f,g,h,j,k,l"
b=split(a,",")
for i=0 to ubound(b)
response.write(b(i))
response.Write ","
next
%>
用,分隔數據的存入:可以使用多選下拉菜單.
<select name="source" size="7" multiple id="source">
<option value="1">fff</option>
<option value="2">tttt</option>
<option value="3">www</option>
<option value="4">aaa</option>
</select>
你可以試一下,當你選擇了多個項目時,request.form("source")的值就是1,2,3 這種格式
4. sql語句查詢什麼時候用逗號什麼時候用句號
as用法:
是給現有的欄位名另指定一個別名的意思,比如:
select username as 用戶名,password as 密碼 from users
補充:比如其中的一個好處是:當欄位名是英文或拼音縮寫時,採用漢字替代之後可以給閱讀帶來方便
sql中as的用法和一些經典的sql語句
1、delete table1 from (select * from table2) as t2 where table1.id=t2.id
2、truncate table table1 (不在事務日誌中做記錄,比delete table快,但不能激活觸發器)
3、update table1 set column=column+1 where id=(select id from table2)
4、update table1 set column=column+1 from table1,table2 where table1.id=table2.id
5、select top n [Percent] * from table1 '輸出百分比記錄
6、select id,column1 * column2 as column from table1 '可算明白as的用法了
7、select * from table1 where column1 like 'SQL#_G_O' escape '#' '單匹配
8、select table1.id from table1 where not exists (select table2.id from table2 where table1.id=table2.id) '這個應該比not in快一些
9、select table1.id from table1,table2 where table1.id<>table2.id '看復合查詢機制
10、select table1.id from table1,table2,(select id from table3) as t3 where table1.id=table2.id and table2.id=t3.id '有些類似[1]了......
11、select * from table1 where column1 like '[A]%' or like '[^B]%'
12、select @column1=column1 from table1;select @column1 as column1 '存儲到自定義變數
5. 求解-SQL語句中逗號的用法!
每個欄位間必須用逗號,SQL關鍵字不需要逗號間
6. sql中逗號有什麼用
這句話的意思是查詢
學生.籍貫,和學生.姓名的總數,因為查詢的是兩個不同的屬性,所以要用逗號分開,就如select
age,name,number
from
students
一樣
7. SQL中逗號的要求
個人建議應該多用幾個符號進行間隔,如','和|,|等,防止像一篇文章裡面有逗號和句號的問題發生
8. 在使用SQL sever2008 寫語句時,什麼時候該用逗號,什麼時候該用圓括弧,都是怎麼規定的
逗號是在使用一些函數的時候用的比如說isnull,convert等,圓括弧基本上在使用函數的時候都用到,但是在寫判斷語句的時候也會用到一些,比如說isnull(A,'') ,convert(varchar(8),getdate(),112)等等。