Sql 整理備忘 雜記

2022-08-19 03:36:09 字數 1133 閱讀 8599

1:排序 (order)

①: ->order('isread asc,createtime desc')

②: $sort_conf['b_order.isread'] = 'asc';       // 正序

$sort_conf['b_order.createtime'] = 'desc';  // 降序

->order($sort_conf)

③:不等於:<>

④:等於null :is null  ; 不等於null:is not null

2:mysql-批量修改表字段中的某一部分內容

語法:update 資料表名 set 欄位名 = replac(欄位名, '要替換的字串', '替換為') wher 設定條件;    

3:mysql中find_in_set()函式的使用

select `id`,`tj_str` from `yk_user` where find_in_set(id,'

10013,10014,10015

'); // 解決in不好解決不了的問題

select `id`,`tj_str` from `yk_user` where find_in_set('10012',tj_str);   // 解決like不好解決的問題

find_in_set()和in的區別:

find_in_set()和like的區別:like是廣泛的模糊匹配,字串中沒有分隔符,find_in_set 是精確匹配,字段值以英文」,」分隔,find_in_set查詢的結果要小於like查詢的結果。

4、mysql兩種儲存引擎: myisam和innodb 簡單總結:

① myisam不支援事務;innodb支援事務

evernote雜記整理

最近翻起讀研期間在evernote中的一些瑣碎記錄,主要包括c語言,fpga和dsp開發的,那個時候還是初學者,犯了很多很弱的錯誤 c語言 1 當乙個變數存放的值為位址值時,想要取出該位址上的值,需要將該變數轉化為指標變數。也可以這麼寫uint32 pa 0xb000 0000,pa int pa ...

sql 資料雜記

1 sql把資料行和彙總行連線起來用union all 注意 如果union上面的是數字形式的,下面的用 就會報錯。2 字串擷取 left string,3 str right string,3 ing 3 日期判斷 datediff d,datefield,getdate 0 當天,第二個日期減去...

雜記箱 有待整理

初始話之一 檢視通過org id進行資料遮蔽時,須在同乙個sql視窗進行賦值給client info responsibility id,作用 在資料庫的會話中設定全域性變數,和使用者概要資訊。引數獲得 引數一,使用者id select user id from fnd user where use...