為記錄新增順序標識的幾種方法。

2021-04-22 00:39:51 字數 349 閱讀 6064

在northwind資料庫中執行:

select

row_number() over(order by customerid desc) as z1,

rank() over(order by customerid asc) as z2,

dense_rank() over(order by customerid asc) as z3,

ntile(4) over(order by customerid asc) as z4,

customerid, city from customers

order by customerid asc

檢視結果,選擇所需要的種類。

Nginx 記錄日誌的幾種方法

nginx的日誌記錄主機設定 server 預設情況下,access log 會使用 combined 的配置來記錄訪問日誌 通常這樣就足夠了。如果是為了更加方便的日誌分析,通常我們會使用特殊字元 如 a 來作為日誌欄位的分隔符,這樣無論是過濾還是排序都會十分方便。甚至可以直接匯入 mysql hi...

JS動態新增事件的幾種方法

js動態新增事件的幾種方法 下面的div2是乙個div 第一種 div2.setattribute onmouseover this.style.backgroundcolor blue div2.setattribute onmouseout this.style.backgroundcolor ...

ios動態新增屬性的幾種方法

在ios執行過程中,有幾種方式能夠動態的新增屬性。1 通過runtime動態關聯物件 主要用到了objc setassociatedobject,objc getassociatedobject以及objc removeassociatedobjects objc view plain copy 在...