sql語句拓展

2021-08-27 10:56:37 字數 703 閱讀 1193

select   insert(tel, 4, 4, '***x')   tel   from   admin

格式:insert(tel, 4, 4, '***x')   tel

第乙個tel:欄位名稱

兩個『4』:分別代表從第4位開始查4位

***x:代表需要替換成什麼

第二個tel:代表別名

select    case   color(欄位名稱)

when   'red'(條件)

then   '紅色'(顯示)

when   'green'   then   '綠色'

when   'blue'   then   '藍色'

else(代表其他條件)   '其他顏色'

end(代表case when語句結束)

color(別名)

from    tablename

或者select    case

when   color='red'(條件)

then   '紅色'(顯示)

when   color='green'   then   '綠色'

when   color='blue'   then   '藍色'

else(代表其他條件)   '其他顏色'

end(代表case when語句結束)

color(別名)

from    tablename

Python基礎 else語句拓展 with語句

def showmaxfactor num count num 2 while count 1 if num count 0 print d的最大約數是 d num,count break 如果執行break,即while迴圈沒執行完,就不執行else語句 count 1 else print d是...

SQL注入漏洞基礎拓展

二 sql漏洞基礎 防範措施 在有些情況下,應用查詢後台使用了錯誤訊息遮蔽方法 比如 遮蔽了報錯,此時無法再根據報錯資訊來進行注入的判斷。這種情況下的注入,稱為 盲注 根據表現形式的不同,盲注又分為based boolean和based time兩種型別。主要表現 手動測試 測試環境 sqlilab...

SQL語句 limit 語句

select from table limit offset,rows rows offset offset 在我們使用查詢語句的時候,經常要返回前幾條或者中間某幾行資料,這個時候怎麼辦呢?不用擔心,mysql 已經為我們提供了上面這樣乙個功能。limit 子句可以被用於強制 select 語句返回...