Mysql知識點集合篇

2022-07-11 07:36:15 字數 1131 閱讀 7931

1.mysql檢視儲存時表前自動新增資料庫名字首問題

問題根源在於在檢視中如果有select * from (select ****),這種巢狀查詢,則就會加上資料庫名稱字首,解決辦法就是把子查詢封裝成子檢視。

2.更新欄位為行號:

set @num = 0

; update ut_project_copy1 set pp = (@num := @num + 1);

3.查詢字段注釋

select column_name,column_comment from

information_schema.columns

where #table_name='

event_base_info

'and

table_schema='

pmes

'and column_comment like '

%姓名%

'

4.設定預設日期和更新日期

`update_time` datetime default null on update current_timestamp,

`create_time` datetime not null default current_timestamp,

5.生成清空資料表語句

select concat('

truncate table

',table_name,'

;') from information_schema.tables where table_schema = '

db1';

6.could not retrieve transation read-only status server(使用了mybatis生成entity):

將pom:

com.alibaba

druid

1.1.14

公升級為:

com.alibaba

druid

1.1.23

集合知識點

1.集合框架中包含哪些集合 collection list arraylist linkedlist vector sethashset treeset maphashmap treemap 2.list集合與set集合的特點 list 有序並且允許重複 set 無需並且不允許重複 3.arrayl...

集合知識點

1.自然排序實現步驟 1.在泛型中的自定義類中實現comparable 自定義類名 2.重寫compareto方法 3.建立treeset集合,向集合中新增元素 2.定製排序實現步驟 1.編寫自定義類 2.單獨定義比較器類,實現comparator 自定義類 3.重寫compare方法 4.建立tr...

mysql知識點歸納 事務篇

願歷盡千帆,歸來仍是少年 簡述何為事務 控制資料的一致性。檢視當前資料庫事務隔離級別 select tx isolation 查詢超過60s的事務 select from information schema.innodb trx where time to sec timediff now trx...