資料庫相關

2021-08-30 11:25:36 字數 917 閱讀 8419

1-多顯示乙個字段,格式:【使用者名稱:手機號】

select *,concat(name,':',tel) from user;
2-手機號顯示:132****22

select *,concat(left(tel,3),'***',right(tel,2)) as '安全手機號' from user;
1-多顯示乙個字段,格式:【使用者名稱:手機號】

select *,concat(name,':',tel) from user;
2-手機號顯示:132****22

select *,concat(left(tel,3),'***',right(tel,2)) as '安全手機號' from user;

-- select *,concat(name,':',tel) as '暱稱' from user;

select *,left(tel,3),right(tel,2), concat(left(tel,3),'***',right(tel,2)) from user;

date

int 時間戳

如何查詢3月份資料(注:18 19 17)

date_format(now(),』%d %b %y』)

select * from 表名 where  created_at = 3月

select * from 表名 where date_format(created_at,'%m') = 3

select * from 表名 where date_format(created_at,'%y') = 2018

建立於

更新於是否刪除:1-是,0-否

ctrl+d 收藏當前**到書籤

資料庫相關

1.操作類 godb public goosundb open throws sqlexception public void close public cursor search int mark mark mark,null,null,null,col date desc if cursor n...

資料庫相關

資料庫的設計 分庫分表,記憶體資料庫,主從讀寫分離,資料庫中介軟體mycat 整合了主從讀寫分離,分庫分表等功能 資料庫優化 sql語句優化,資料庫配置優化,索引優化,資料庫設計優化 資料庫的鎖 1.樂觀鎖,表中增加版本字段,每次更改加1,查的時候先把版本字段查出來,更新的時候加上條件版本欄位沒變,...

資料庫相關

1.更改登入的預設資料庫 比如你刪掉了乙個資料庫 然後sql賬號登陸不上去了 說 沒有預設賬號 那是因為你剛好刪掉了這個賬號的預設資料庫 執行下邊的語句就好了,也就是設定master為你sql賬號的預設資料庫 exec sp defaultdb sa master 2.cmd命令執行sql檔案 說明...